strip off trailing commas