check for unmatched close braces at top level