fixed equals implementation