fixed bug in tree