fixed a bug in isEqual of constructor