fix http connection handling