tree order bug fix