Added 'MarkDirty' function.