-fixed validate_name function. It now returns the name if it is valid.