Fix to stop the form submission being forgotten if an error occurs