writing to .json file