Add method addNode
Correct bug in setTree