graceful server shutdown improved