added duplicate item checking