Correctly handling form submission