add method for server exit