fixed socket close bug