updated client side form validation