fixed persisting data to data.json file