Fix unbalanced brackets issue