adjustments to useInventory

useInventory function adjusted.