bad bracket detection