added form validation and tests