'Modified',Work only once

I set up this listener, but it only works the first time,I don’t know why。
I’ve set addModelChangedListener, and that works. But I still want to know about Modified.
this.myDiagram?.addDiagramListener(‘Modified’, (e) => {
if (this.myDiagram) {
this.myDiagram.isModified = false;
const iter = this.myDiagram?.selection.iterator;
iter?.iterator.each((node) => {

Note that the documentation https://gojs.net/latest/api/symbols/Diagram.html#isModified states:

A “Modified” DiagramEvent listener must not modify this Diagram or its Model.

If you programmatically set Diagram.isModified to false during a transaction in which some modifications have occurred, Diagram.isModified will remain true until after the transaction has finished and the “Modified” DiagramEvent will be raised then.