Add validate method.