updated duplicate prevention