Added check for if the inv. is open in clickItem