I have some questions.

Do you want to prevent duplicates? If so, take a look at ganeshmoorthy's post?

Do you want to allow duplicates, but flag them? If so, there is code for that as well.