added check for parentheses on main