fixed the JSON saving