Reset writeState after writing