close socket after redirect