add checkBraces method