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)
