fix extra comma at end of array