adds form validation