added code for form to retain data, if invalid form submitted