add modified flag manipulation