diff --git a/model/sync-logic.cc b/model/sync-logic.cc
index 860f119..943126b 100644
--- a/model/sync-logic.cc
+++ b/model/sync-logic.cc
@@ -178,7 +178,7 @@
 }
 
 void
-SyncLogic::respondSyncData (const std::string &name, const std::string &dataBuffer)
+SyncLogic::respondSyncData (const std::string &name, const char *wireData, size_t len)
 {
   try
     {
@@ -190,13 +190,13 @@
 
       if (type == "normal")
         {
-          processSyncData (name, digest, dataBuffer);
+          processSyncData (name, digest, wireData, len);
         }
       else
         {
           // timer is always restarted when we schedule recovery
           m_scheduler.cancel (REEXPRESSING_RECOVERY_INTEREST);
-          processSyncData (name, digest, dataBuffer);
+          processSyncData (name, digest, wireData, len);
         }
     }
   catch (Error::DigestCalculationError &e)
@@ -263,7 +263,7 @@
 }
 
 void
-SyncLogic::processSyncData (const std::string &name, DigestConstPtr digest, const string &dataBuffer)
+SyncLogic::processSyncData (const std::string &name, DigestConstPtr digest, const char *wireData, size_t len)
 {
   DiffStatePtr diffLog = make_shared<DiffState> ();
   bool ownInterestSatisfied = false;
@@ -277,8 +277,14 @@
       ownInterestSatisfied = (name == m_outstandingInterestName);
 
       DiffState diff;
-      istringstream ss (dataBuffer);
-      ss >> diff;
+      SyncStateMsg msg;
+      if (!msg.parseFromArray(wireData, len) || !msg.IsInitialized()) 
+      {
+        //Throw
+        BOOST_THROW_EXCEPTION (SyncStateMsgDecodingFailure () << info_str ("Can not decode data"));
+      }
+      msg >> diff;
+
       vector<MissingDataInfo> v;
       BOOST_FOREACH (LeafConstPtr leaf, diff.getLeaves().get<ordered>())
         {
@@ -332,7 +338,7 @@
 
       insertToDiffLog (diffLog);
     }
-  catch (Error::SyncXmlDecodingFailure &e)
+  catch (Error::SyncStateMsgDecodingFailure &e)
     {
       _LOG_TRACE ("Something really fishy happened during state decoding " <<
                   diagnostic_information (e));
@@ -486,8 +492,8 @@
                         bind (&SyncLogic::sendSyncInterest, this),
                         REEXPRESSING_INTEREST);
   
-  m_ccnxHandle->sendInterestForString (os.str (),
-                              bind (&SyncLogic::respondSyncData, this, _1, _2));
+  m_ccnxHandle->sendInterest (os.str (),
+                              bind (&SyncLogic::respondSyncData, this, _1, _2, _3));
 }
 
 void
@@ -508,8 +514,8 @@
                             REEXPRESSING_RECOVERY_INTEREST);
     }
 
-  m_ccnxHandle->sendInterestForString (os.str (),
-                              bind (&SyncLogic::respondSyncData, this, _1, _2));
+  m_ccnxHandle->sendInterest (os.str (),
+                              bind (&SyncLogic::respondSyncData, this, _1, _2, _3));
 }
 
 
@@ -518,9 +524,15 @@
 {
   _LOG_TRACE (">> D " << name);
   // sending
-  m_ccnxHandle->publishStringData (name,
-                             lexical_cast<string> (*state),
+  SyncStateMsg ssm;
+  ssm << (*state);
+  char *wireData = new char[ssm.size()];
+  ssm.SerializedToArray(wireData, ssm.size());
+  m_ccnxHandle->publishRawData (name,
+                             wireData,
+                             ssm.size(),
                              m_syncResponseFreshness); // in NS-3 it doesn't have any effect... yet
+  delete wireData;
 
   // checking if our own interest got satisfied
   bool satisfiedOwnInterest = false;
