check object for equality rather than for reference