fixed isEqual method