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

        delete tabs[key] for key, value of tabs when value.sessionKey is editor.sessionKey
        @workspaceRef.set "tabs": tabs

    if file
      @workspaceRef.child("tabs").push
        path       : file.path
        sessionKey : editor.sessionKey

  recoverOldSessionTabs: ->
    @workspaceRef.once "value", (snapshot) =>

      tabHandleContainer : @tabHandleContainer

  createEditorInstance: (file, content, sessionKey) ->
    if file
      fileIndexInOpenedFiles = @openedFiles.indexOf(file.path)
      if fileIndexInOpenedFiles > -1
        log "same file detected, setting tab acive"
        return  @tabView.showPaneByIndex fileIndexInOpenedFiles + 1

    pane   = new KDTabPaneView
      name : file?.name or "untitled.js"

