checks for duplicate names