Changed updateInventory to work properly