sample implementation for validating user input (like form data)