fixes infinite loop when duplicate item encountered