checking brackets