Added extra check for inventory quantites in sapos