problem on get tree function