close socket on disconnect