fixed JSON generation