How to modify an array of objects if two following objects have different value