fix server close bug