fix for crash on unexpected http response code