improving http connection handling