fixed addToMemo impl

should rewrite whole object not only the reference.