fixing read/write from json file