how to change the elements inside an object which is inside an array using forEach loop