ensure the application context is shutdown