cater for the case where the form is submit