Move all connection close to get_request function