compare objects in an array by a property value