fix curly braces balancing on unrecognized code