fix server close