added some frontend form validation