succesfully writing json to file