added dynamictreeflag used for indicating that a node is in a dynamic
tree or not