fixed data_to_json_file