Added cleanup on server shutdown