complete logic for no repeat name