You should not flush inside a listener as the listener is called *inside* a flush. It will cause weird issue.

Instead, you should mae the change be added in the current changeset.