Problem in wrapping statements

Hi

I have to wrap all the expression which uses logical, relational and comparison operator. I am doing this by

         virtual bool VisitBinaryOperator(BinaryOperator *bo){
             if(bo->isLogicalOp() || bo->isComparisonOp() || bo->isRelationalOp()){
                 std::string name= "WRAPCONDITION(";
rewriter.InsertTextBefore(bo->getLHS()->getLocStart(),name);
                 name = " ) ";
rewriter.InsertTextAfterToken(bo->getRHS()->getLocEnd(),name);
             }
             return true;
         }
But this is giving me some wiered answer

Ex

a = b == c;

output is

a = WRAPCONDITION(b == c ; // closing bracket is missing.

Can anyone please help me in this?