diff --git a/src/sync-core.cc b/src/sync-core.cc
index 8319c21..164296a 100644
--- a/src/sync-core.cc
+++ b/src/sync-core.cc
@@ -25,6 +25,34 @@
 const double SyncCore::WAIT = 0.05;
 const double SyncCore::RANDOM_PERCENT = 0.5;
 
+// for debugging
+static void
+printMsg(SyncStateMsgPtr &msg)
+{
+  cout << " ===== start Msg ======" << endl;
+  int size = msg->state_size();
+  if (size > 0)
+  {
+    int index = 0;
+    while (index < size)
+    {
+      SyncState state = msg->state(index);
+      string strName = state.name();
+      string strLocator = state.locator();
+      sqlite3_int64 seq = state.seq();
+      cout << "Name: " << Name((const unsigned char *)strName.c_str(), strName.size());
+      cout << ", Locator: " << Name((const unsigned char *)strLocator.c_str(), strLocator.size());
+      cout << ", seq: " << seq << endl;
+      index ++;
+    }
+  }
+  else
+  {
+    cout << "Msg size 0" << endl;
+  }
+  cout << " ++++++++ end Msg  ++++++++ \n\n" << endl;
+}
+
 SyncCore::SyncCore(SyncLogPtr syncLog, const Name &userName, const Name &localPrefix, const Name &syncPrefix, const StateMsgCallback &callback, const CcnxWrapperPtr &handle, const SchedulerPtr &scheduler)
          : m_log(syncLog)
          , m_scheduler(scheduler)
@@ -68,6 +96,10 @@
   {
     locator = m_yp[deviceName];
   }
+  else
+  {
+    cout << "self: " << m_userName << ", deviceName: " << deviceName << " not found in yp " << endl;
+  }
   return locator;
 }
 
@@ -96,6 +128,7 @@
   msgToBytes(msg, syncData);
   m_handle->publishData(syncName, syncData, FRESHNESS);
   cout << m_userName << " publishes: " << *oldHash << endl;
+  printMsg(msg);
 
   // no hurry in sending out new Sync Interest; if others send the new Sync Interest first, no problem, we know the new root hash already;
   // this is trying to avoid the situation that the order of SyncData and new Sync Interest gets reversed at receivers
@@ -161,6 +194,7 @@
     msgToBytes(msg, syncData);
     m_handle->publishData(name, syncData, FRESHNESS);
     cout << m_userName << " publishes " << hash << endl;
+    printMsg(msg);
   }
   else
   {
@@ -188,6 +222,8 @@
     Bytes syncData;
     msgToBytes(msg, syncData);
     m_handle->publishData(name, syncData, FRESHNESS);
+    cout << m_userName << " publishes: " << *hash << endl;
+    printMsg(msg);
   }
   else
   {
@@ -251,6 +287,8 @@
     return;
   }
 
+  cout << m_userName << " receives Msg " << endl;
+  printMsg (msg);
   int size = msg->state_size();
   int index = 0;
   while (index < size)
@@ -272,6 +310,7 @@
         m_log->UpdateLocator(deviceName, locatorName);
         WriteLock lock(m_ypMutex);
         m_yp[deviceName] = locatorName;
+        cout << "self: " << m_userName << ", device: " << deviceName << " < == > " << locatorName << endl;
       }
     }
     else
diff --git a/test/test-sync-core.cc b/test/test-sync-core.cc
index 6936d57..e91b0f5 100644
--- a/test/test-sync-core.cc
+++ b/test/test-sync-core.cc
@@ -22,6 +22,13 @@
 BOOST_AUTO_TEST_CASE(SyncCoreTest)
 {
   string dir = "./SyncCoreTest";
+  // clean the test dir
+  path d(dir);
+  if (exists(d))
+  {
+    remove_all(d);
+  }
+
   string dir1 = "./SyncCoreTest/1";
   string dir2 = "./SyncCoreTest/2";
   Name user1("/joker");
@@ -36,12 +43,6 @@
 
   SchedulerPtr scheduler(new Scheduler());
 
-  // clean the test dir
-  path d(dir);
-  if (exists(d))
-  {
-    remove_all(d);
-  }
 
   SyncCore *core1 = new SyncCore(log1, user1, loc1, syncPrefix, bind(callback, _1), c1, scheduler);
   usleep(10000);
@@ -54,16 +55,19 @@
   usleep(100000);
   checkRoots(core1->root(), core2->root());
   BOOST_CHECK_EQUAL(core2->seq(user1), 1);
+  BOOST_CHECK_EQUAL(core2->yp(user1), loc1);
 
   core1->updateLocalState(5);
   usleep(100000);
   checkRoots(core1->root(), core2->root());
   BOOST_CHECK_EQUAL(core2->seq(user1), 5);
+  BOOST_CHECK_EQUAL(core2->yp(user1), loc1);
 
   core2->updateLocalState(10);
   usleep(100000);
   checkRoots(core1->root(), core2->root());
   BOOST_CHECK_EQUAL(core1->seq(user2), 10);
+  BOOST_CHECK_EQUAL(core1->yp(user2), loc2);
 
   // simple simultaneous data generation
   cout << "\n\n\n\n\n\n----------Simultaneous\n";
@@ -75,6 +79,11 @@
   BOOST_CHECK_EQUAL(core1->seq(user2), 15);
   BOOST_CHECK_EQUAL(core2->seq(user1), 11);
 
+  BOOST_CHECK_EQUAL(core1->yp(user1), loc1);
+  BOOST_CHECK_EQUAL(core1->yp(user2), loc2);
+  BOOST_CHECK_EQUAL(core2->yp(user1), loc1);
+  BOOST_CHECK_EQUAL(core2->yp(user2), loc2);
+
   // clean the test dir
   if (exists(d))
   {
