updated to_json