Modify handlers to only be called when the form is submitted