calling app.onTerminate() before closing state providers