cleaned up form validation example