added some form validation