fix server shutdown