The application now closes as expected.