improve find close brace
Merge pull request #1144 from diegosarmentero/master

improve find close brace