bugfix in tree filtering