       val  = snapshot.val()
       return unless val
 
-      {tabs} = snapshot.val()
+      if val.ActiveTabIndex?
+        @tabView.showPaneByIndex val.ActiveTabIndex
+        return @workspaceRef.child("ActiveTabIndex").remove()
+
+      {tabs} = val
       return unless tabs
 
       for key, data of tabs


    pane.addSubView editor
    @tabView.addPane pane

    pane.on "KDTabPaneDestroy", =>
      @workspaceRef.once "value", (snapshot) =>

    @workspaceRef     = @workspace.firepadRef.child @sessionKey
    @isJoinedASession = @getOptions().sessionKey
    @openedFiles      = []
    @activeTabIndex   = 0

    log "joined an old session again, creating new tabbed editor" if @isJoinedASession

