502 Bad Gateway error shown after submitting form