fix for bug due to using wrong tree traversal