Fixed duplicate check