 
   refreshSidebarVMs: ->
     @fetchVMs (vms) =>
-      @vmsList.removeAllItems()
+      @vmTree.removeAllNodes()
       @listVMs vms
 
   getRelativeItem: (increment, predicate) ->

      items        : []


    @vmsList = new KDListViewController
      wrapper             : no
      scrollView          : no
      startWithLazyLoader : yes
      itemClass           : NavigationVMItem
      lazyLoaderOptions   : loaderOptions
    ,
      id           : 'vms'
      title        : 'vms'
      items        : []

    @vmsList.getListView().on 'VMCogClicked', (vm, item)->
      {mainView} = KD.singletons
      mainView.openVMModal vm, item

    # {mainController} = KD.singletons
    # mainController.ready @bound 'accountChanged'


          env = new EnvironmentMachineContainer
          env.emit 'PlusButtonClicked'

    dock.addSubView new KDCustomHTMLView
      tagName  : 'h3'
      cssClass : 'sidebar-title'
      partial  : 'MY APPS'

    dock.addSubView @navController.getView()
    dock.addSubView new CustomLinkView
      icon     : no
      cssClass : 'kdlistitemview-main-nav add-app'
      title    : '+ Add more apps'
      href     : '/Apps'



    # @navController.reset()
    # @setNavItems defaultItems
    @setNavItems defaultItems
    @emit 'ready'

    @ready =>

