Fix an issue: crash when reopen the app.