function removeLastComma(str) {
       return str.replace(/,(\s+)?$/, '');
}