Added validate function to resolve wp-833