502 Error when re-submitting form