fixed duplicate item giving code