fixed bug in tree reader