added check to see if names are duplicates