fix server closing