fix error when comparing to different trees