added method to check for repeated names