undefined inventory item fix