       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 : ->

      point.treeId = @activeTree.treeId
      @trees[@activeTree.treeIndex] = point
      @activeTree = point
    @activeNode = point
    @lastActiveNodeId = @activeNode.id
    #console.log @activeTree.toString()
    #console.log @getNodeList()
    #for item in @getNodeList()
    #  console.log item.id

  getActiveNodeId : ->
    @lastActiveNodeId

    sentinel.treeId = @treeIdCount++
    # save Index, so we can access it once we have the root element
    sentinel.treeIndex = @trees.length
    sentinel.isSentinel = true
    @trees.push(sentinel)
    @activeTree = sentinel
    @activeNode = null
