seems to work; however 2 suspicious things:
1. it has to wait for more than 200ms for sync to finish (after the second guy publishes)
2. sometimes the guy who publishes data sends data interests for his own data, sometimes not
diff --git a/ccnx/sync-app-socket.cc b/ccnx/sync-app-socket.cc
index ce65674..cc97fbf 100644
--- a/ccnx/sync-app-socket.cc
+++ b/ccnx/sync-app-socket.cc
@@ -61,6 +61,7 @@
   uint32_t sequence = getNextSeq(prefix, session);
   ostringstream contentNameWithSeqno;
   contentNameWithSeqno << prefix << "/" << session << "/" << sequence;
+
   m_ccnxHandle->publishRawData (contentNameWithSeqno.str (), buf, len, freshness);
 
   SeqNo s(session, sequence + 1);
@@ -82,6 +83,7 @@
 {
   ostringstream interestName;
   interestName << prefix << "/" << seq.getSession() << "/" << seq.getSeq();
+  //std::cout << "Socket " << this << " Send Interest <" << interestName.str() << "> for raw data " << endl;
   m_ccnxHandle->sendInterest(interestName.str(), callback, retry);
 }
 
diff --git a/ccnx/sync-ccnx-wrapper.cc b/ccnx/sync-ccnx-wrapper.cc
index 559cfad..7fbbfa6 100644
--- a/ccnx/sync-ccnx-wrapper.cc
+++ b/ccnx/sync-ccnx-wrapper.cc
@@ -166,6 +166,7 @@
 int
 CcnxWrapper::publishRawData (const string &name, const char *buf, size_t len, int freshness)
 {
+
   recursive_mutex::scoped_lock lock(m_mutex);
   if (!m_running)
     return -1;
diff --git a/test/test_app_socket.cc b/test/test_app_socket.cc
index d502822..5e7ddc2 100644
--- a/test/test_app_socket.cc
+++ b/test/test_app_socket.cc
@@ -51,6 +51,19 @@
     data.insert(make_pair(str1, str2));
     // cout << str1 << ", " << str2 << endl;
   }
+  
+  void setNum(string str1, const char *buf, size_t len) {
+    int n = len / 4;
+    int *numbers = new int [n];
+    memcpy(numbers, buf, len);
+    for (int i = 0; i < n; i++) {
+      sum += numbers[i];
+    }
+    delete numbers;
+
+  }
+
+  int sum;
 
   void fetchAll(const vector<MissingDataInfo> &v, SyncAppSocket *socket) {
     int n = v.size();
@@ -59,12 +72,26 @@
 
     for (int i = 0; i < n; i++) {
       for(SeqNo s = v[i].low; s <= v[i].high; ++s) {
-        PRINT
+        //PRINT
         socket->fetchString(v[i].prefix, s, bind(&TestSocketApp::set, this, _1, _2));
       }
     }
   }
 
+  void fetchNumbers(const vector<MissingDataInfo> &v, SyncAppSocket *socket) {
+    int n = v.size();
+
+    PRINT
+
+    std::cout << "In fetchNumbers. size of v is:  " << n << std::endl;
+    for (int i = 0; i < n; i++) {
+      for(SeqNo s = v[i].low; s <= v[i].high; ++s) {
+        PRINT
+        socket->fetchRaw(v[i].prefix, s, bind(&TestSocketApp::setNum, this, _1, _2, _3));
+      }
+    }
+  }
+
   void pass(const string &prefix) {
   }
 
@@ -167,5 +194,32 @@
   BOOST_CHECK_EQUAL(a1.toString(), a2.toString());
   BOOST_CHECK_EQUAL(a2.toString(), a3.toString());
 
+  _LOG_DEBUG("Begin new test");
+  std::cout << "Begin new Test " << std::endl;
+  string syncRawPrefix = "/this/is/the/prefix";
+  a1.sum = 0;
+  a2.sum = 0;
+  SyncAppSocket s4 (syncRawPrefix, bind(&TestSocketApp::fetchNumbers, &a1, _1, _2), bind(&TestSocketApp::pass, &a1, _1));
+  SyncAppSocket s5 (syncRawPrefix, bind(&TestSocketApp::fetchNumbers, &a2, _1, _2), bind(&TestSocketApp::pass, &a2, _1));
+
+  int num[5] = {0, 1, 2, 3, 4};
+
+  string p4 = "/xiaonei.com";
+  string p5 = "/mitbbs.com";
+
+  s4.publishRaw(p4, 0,(const char *) num, sizeof(num), 10);
+  a1.setNum(p4, (const char *) num, sizeof (num));
+
+  this_thread::sleep (posix_time::milliseconds (200));
+  BOOST_CHECK(a1.sum == a2.sum && a1.sum == 10);
+
+  int newNum[5] = {9, 7, 2, 1, 1};
+
+  s5.publishRaw(p5, 0,(const char *) newNum, sizeof(newNum), 10);
+  a2.setNum(p5, (const char *)newNum, sizeof (newNum));
+  this_thread::sleep (posix_time::milliseconds (1000));
+  BOOST_CHECK_EQUAL(a1.sum, a2.sum);
+  BOOST_CHECK_EQUAL(a1.sum, 30);
+
   _LOG_DEBUG ("Finish");
 }
diff --git a/test/test_ccnx_wrapper.cc b/test/test_ccnx_wrapper.cc
index c10930c..4df8156 100644
--- a/test/test_ccnx_wrapper.cc
+++ b/test/test_ccnx_wrapper.cc
@@ -44,14 +44,16 @@
     s_str1 = str1;
     s_str2 = str2;
   }
-  char *m_buf;
-  size_t m_len;
+  int * num;
+  int n;
 
   void rawSet(string str1, const char *buf, size_t len) {
     std::cout << "In rawSet" << std::endl;
-    m_buf = (char  *)calloc(1, len);
-    memcpy(m_buf, buf, len);
     s_str1 = str1;
+
+    n = len / 4; 
+    num = new int [n];
+    memcpy(num, buf, len);
   }
 };
 
@@ -96,9 +98,12 @@
   int num[5] = {0, 1, 2, 3, 4};
   ha.publishRawData(rawDataName, (const char *)num, sizeof(num), 30);
   hb.sendInterest(rawDataName, rawFunc);
+
+  this_thread::sleep (posix_time::milliseconds (5));
   BOOST_CHECK_EQUAL(foo.s_str1, rawDataName);
-  
-  BOOST_CHECK(memcmp((char *)num, foo.m_buf, foo.m_len) == 0);
+  for (int i = 0; i < 5; i++) {
+    BOOST_CHECK(foo.num[i] == num[i]);
+  }
 }
 
 
diff --git a/wscript b/wscript
index 8c52b8b..314327e 100644
--- a/wscript
+++ b/wscript
@@ -52,7 +52,7 @@
         conf.define ('_DEBUG', 1)
         conf.env.append_value('CXXFLAGS', ['-O0', '-g3'])
     else:
-        conf.env.append_value('CXXFLAGS', ['-O3'])
+        conf.env.append_value('CXXFLAGS', ['-O3', '-g'])
 
     if conf.options._test:
       conf.define('_TEST', 1)