validate brackets