fix socket close