Worked on saving data.json file when terminating the app