502 Bad Gateway error on submit