form validation, cleanup