changed how the application exits