Fixing an unbalanced parentheses