Attempted to fix crashing when resumng the app.