diff --git a/model/sync-ccnx-wrapper.cc b/model/sync-ccnx-wrapper.cc
index aa7ab8c..d531971 100644
--- a/model/sync-ccnx-wrapper.cc
+++ b/model/sync-ccnx-wrapper.cc
@@ -31,12 +31,19 @@
 
 namespace Sync {
 
+#ifdef _DEBUG_WRAPPER_      
+CcnxWrapper::CcnxWrapper(char c)
+#else
 CcnxWrapper::CcnxWrapper()
+#endif
   : m_handle (0)
   , m_keyStore (0)
   , m_keyLoactor (0)
   , m_running (true)
 {
+#ifdef _DEBUG_WRAPPER_      
+  m_c = c;
+#endif
   m_handle = ccn_create ();
   initKeyStore ();
   createKeyLocator ();
@@ -106,17 +113,17 @@
 void
 CcnxWrapper::ccnLoop ()
 {
-  pollfd pfds[1];
-
-  pfds[0].fd = ccn_get_connection_fd (m_handle);
-  pfds[0].events = POLLIN;
 
   while (m_running)
     {
+#ifdef _DEBUG_WRAPPER_      
+      std::cout << m_c << flush;
+#endif
       int res = 0;
       {
         recursive_mutex::scoped_lock lock (m_mutex);
         res = ccn_run (m_handle, 0);
+
       }
 
       if (!m_running) break;
@@ -125,12 +132,22 @@
         BOOST_THROW_EXCEPTION (CcnxOperationException()
                                << errmsg_info_str("ccn_run returned error"));
 
-      int ret = poll(pfds, 1, 10);
+
+      pollfd pfds[1];
+      {
+        recursive_mutex::scoped_lock lock (m_mutex);
+        
+        pfds[0].fd = ccn_get_connection_fd (m_handle);
+        pfds[0].events = POLLIN;
+        if (ccn_output_is_pending (m_handle))
+          pfds[0].events |= POLLOUT;
+      }
+      
+      int ret = poll (pfds, 1, 1);
       if (ret < 0)
         {
           BOOST_THROW_EXCEPTION (CcnxOperationException() << errmsg_info_str("ccnd socket failed (probably ccnd got stopped)"));
         }
-
     }
 }
 
diff --git a/model/sync-ccnx-wrapper.h b/model/sync-ccnx-wrapper.h
index ecfeee3..e7a1a64 100644
--- a/model/sync-ccnx-wrapper.h
+++ b/model/sync-ccnx-wrapper.h
@@ -61,7 +61,12 @@
    * keystore 2) init keylocator 3) start a thread to hold a loop of ccn_run
    *
    */
+#ifdef _DEBUG_WRAPPER_      
+  CcnxWrapper(char c='.');
+  char m_c;
+#else
   CcnxWrapper();
+#endif  
   ~CcnxWrapper();
 
   /**
diff --git a/test/test_ccnx_wrapper.cc b/test/test_ccnx_wrapper.cc
index 1cd1394..ad69262 100644
--- a/test/test_ccnx_wrapper.cc
+++ b/test/test_ccnx_wrapper.cc
@@ -35,52 +35,50 @@
 string echoStr = "";
 
 void echo(string str) {
-	echoStr = str;
+  echoStr = str;
 }
 
 struct TestStruct {
-	string s_str1, s_str2;
-	void set(string str1, string str2) {
-		s_str1 = str1;
-		s_str2 = str2;
-	}
+  string s_str1, s_str2;
+  void set(string str1, string str2) {
+    s_str1 = str1;
+    s_str2 = str2;
+  }
 };
 
 BOOST_AUTO_TEST_CASE (CcnxWrapperTest)
 {
-
-	CcnxWrapper ha;
-	CcnxWrapper hb;
+  CcnxWrapper ha;
+  CcnxWrapper hb;
 	
-	TestStruct foo;
+  TestStruct foo;
 	
-	boost::function<void (string)> globalFunc = echo;
-	boost::function<void (string, string)> memberFunc =
-	bind(&TestStruct::set, &foo, _1, _2);
+  boost::function<void (string)> globalFunc = echo;
+  boost::function<void (string, string)> memberFunc =
+    bind(&TestStruct::set, &foo, _1, _2);
 
-	string prefix = "/ucla.edu";
-	ha.setInterestFilter(prefix, globalFunc);
+  string prefix = "/ucla.edu";
+  ha.setInterestFilter(prefix, globalFunc);
+  this_thread::sleep (posix_time::milliseconds (10));
 
-	string interest = "/ucla.edu/0";
-	hb.sendInterest(interest, memberFunc);
+  string interest = "/ucla.edu/0";
+  hb.sendInterest(interest, memberFunc);
 
-	// give time for ccnd to react
-	sleep(1);
+  // give time for ccnd to react
+  // sleep(1);
+  this_thread::sleep (posix_time::milliseconds (5));
+  BOOST_CHECK_EQUAL(echoStr, interest);
 
-	BOOST_CHECK_EQUAL(echoStr, interest);
+  string name = "/ucla.edu/0";
+  string data = "random bits: !#$!@#$!";
+  ha.publishData(name, data, 5);
 
+  hb.sendInterest(interest, memberFunc);
 
-	string name = "/ucla.edu/0";
-	string data = "random bits: !#$!@#$!";
-	ha.publishData(name, data, 5);
-
-	hb.sendInterest(interest, memberFunc);
-
-	// give time for ccnd to react
-	sleep(1);
-	BOOST_CHECK_EQUAL(foo.s_str1, name);
-	BOOST_CHECK_EQUAL(foo.s_str2, data);
-
+  // give time for ccnd to react
+  this_thread::sleep (posix_time::milliseconds (5));
+  BOOST_CHECK_EQUAL(foo.s_str1, name);
+  BOOST_CHECK_EQUAL(foo.s_str2, data);
 }
 
 
