Changes file writing to read/write create for storing state.