Changing way dirty flag is set