add close function for http connection