handle invalid comas in epxression and redudant closing brace