i added played owned shops from here

http://www.rune-server.org/runescape...ned-shops.html

and ive fixed a few bugs already but theirs one i cant figure out how to fix im sure its pretty simple but i cant get it i need to make it so when you log out your shop interface closes for people viewing it or they cant buy from it because it wont delete the item from your account if your logged out so how would i do this incase you dont understand heres an example

player one opens his shop and puts stuff in it
player two views player ones shop
player one logs out but his shop is still open for player two
player two then can buy player ones items from his shop and they wont be removed because player ones not logged in

so how would i make it so either the trade closes when player one logs out or player two cant buy anything while player one is logged out

heres my shopassistant.java

Shopassistant.java - Pastebin.com