Bug fixed related to activity lifecycle