logging newValue within the  function