added form validation handling to activity form