Added flag to stop call to init by write_data at the end of the run.