fix brackets on sql operation