removes the `dirty` flags