Making sure servers shut down correctly