Handling self writing with a flag.