added form validation with email functionality