added server shutdown to server exit