close socket on redirect