fix invalid parentheses intersection