fix bug where trailing comma was left in the json content