Ensuring the right history is written back to the history.json file!