Correct stop the server when exit