     @workspaceRef     = @workspace.firepadRef.child @sessionKey
     @isJoinedASession = @getOptions().sessionKey
     @openedFiles      = []
+    @activeTabIndex   = 0
 
     log "joined an old session again, creating new tabbed editor" if @isJoinedASession
 

    @tabView = new ApplicationTabView
      delegate           : @
      tabHandleContainer : @tabHandleContainer

  createEditorInstance: (file, content, sessionKey) ->
    if file

      val  = snapshot.val()
      return unless val

      if val.ActiveTabIndex?
        @tabView.showPaneByIndex val.ActiveTabIndex
        return @workspaceRef.child("ActiveTabIndex").remove()

      {tabs} = val
      return unless tabs

      for key, data of tabs
