Modified code for submit button