Fixed crash when going back from activities