validate method added

validate method added, to show how to use custom validations