remove trailing commas following arrays