fixed check for item instance causing index out of bounds error