Fixing issue with duplicate items appearing in the inventory