fix tree helper