added function to the submit button