fix tree switch