updated form validation and flashdata