Add validate method.

Validate name field.