Added input validation to the name field