Fixed reduce code in modify