Bad Gateway error on submission