Change to output an error message when encountering unbalanced parenthesis