Added the validate function to resolve wp-905