Bugfix for server shutdown