Solved the rare duplicate issue