updated submit button functionality