handle trailing commas