fix crash when resume the activity