Fixed problem with null value in validate method.