Fixed mistake in previous commit to correctly handle 502 error.