fix response.statusCode checking