tree iteration fix