Added functionality to the submit button