fix close socket everywhere