added form validation