improve find close brace

improve find close brace