used treeView.getValue instead of lastItemId.