Fixed some errors appeared when inserting new data in json files