Security check for validator function