Fixed a bug : in some cases, current activity is not set correctly