now setting 502 bad gateway instead of status 0