added an app->shutdown function.