Added form validation method