fix equals problem caused by inheritance