changed connection to match new http.client implementation