 
     if KD.isLoggedIn()
       @emit 'AppManagerWantsToShowAnApp', appInstance, appView, appOptions
+      @setLastActiveIndex appInstance
       callback? appInstance
     else
       KD.getSingleton('router').handleRoute '/', replaceState: yes

    appView?.once "KDObjectWillBeDestroyed", =>
      @unregister appInstance






    if KD.isLoggedIn()
      @emit 'AppManagerWantsToShowAnApp', appInstance, appView, appOptions
      @setLastActiveIndex appInstance
      callback? appInstance
    else
      KD.getSingleton('router').handleRoute '/', replaceState: yes
