fix to_json