Closes #7180
This is safer in case exception is raised before so the browser may try to submit the form and trigger a reload of the application. Closes #6419