Create validation_function