Added form validation.