Fix form resubmit bug on page reload