fix tree hierarcchy