       if tree.treeId == id
         @activeTree = tree
         break
-    @activeNode = @activeTree
-    @lastActiveNodeId = @activeNode.id
+    if @activeTree.isSentinel
+      @activeNode = null
+    else
+      @activeNode = @activeTree
+      @lastActiveNodeId = @activeNode.id
     @push()
 
   createNewTree : ->

      @activeNode.remove(id)
      @lastActiveNodeId = @activeNode.id
    else
      @deleteActiveTree()
    @push()


    # to create one.
    if @trees.length == 0
      @createNewTree()
    else
      # just set the last tree to be the active one
      @setActiveTree(@trees[@trees.length - 1].treeId)
    @push()

  getTree : (id) ->
