add id to tree node.