added front end form validation