fix tree API