tree factor bug fix