Added Dirty Flag

This resolves issue #146