Added extra check for inventory quantites