implementing modified flag