fixed the problem with looking in trees.