handeled error in bracket matching