fixed a bug in the tree string processing