tree width check