use deep equals for object comparison