Form validation

added some form validation