fix a bug bucause of the activity's life cycle