fixed bug about tree comparison