fix http client connection handling