added validation for the name field