fixed first duplicate check