diff --git a/src/sync-policy-manager.cc b/src/sync-policy-manager.cc
index 86726d3..0c663b1 100644
--- a/src/sync-policy-manager.cc
+++ b/src/sync-policy-manager.cc
@@ -33,7 +33,7 @@
   m_syncPrefixRegex = Regex::fromName(syncPrefix);
   m_wotPrefixRegex = Regex::fromName(wotPrefix);
   m_chatDataPolicy = Ptr<IdentityPolicyRule>(new IdentityPolicyRule("^[^<FH>]*<FH>([^<chronos>]*)<chronos><>",
-                                                                    "^(<>*)<KEY><DSK-.*><ID-CERT><>$",
+                                                                    "^(<>*)<KEY><dsk-.*><ID-CERT>$",
                                                                     "==", "\\1", "\\1", true));  
 }
   
@@ -54,11 +54,11 @@
 					   const DataCallback& verifiedCallback,
 					   const UnverifiedCallback& unverifiedCallback)
 {
-#ifdef _DEBUG
-  _LOG_DEBUG("checkVerificationPolicy");
-  verifiedCallback(data);
-  return NULL;
-#else
+// #ifdef _DEBUG
+//   _LOG_DEBUG("checkVerificationPolicy");
+//   verifiedCallback(data);
+//   return NULL;
+// #else
   //TODO:
   if(stepCount > m_stepLimit)
     {
@@ -74,10 +74,13 @@
     }
 
   const Name& keyLocatorName = sha256sig->getKeyLocator().getKeyName();
+  _LOG_DEBUG("data name: " << data->getName());
+  _LOG_DEBUG("signer name: " << keyLocatorName);
   
   // if data is intro cert
   if(m_wotPrefixRegex->match(data->getName()))
     {
+      _LOG_DEBUG("Intro Cert");
       Name keyName = IdentityCertificate::certificateNameToPublicKeyName(keyLocatorName);
       map<Name, Publickey>::const_iterator it = m_trustedIntroducers.find(keyName);
       if(m_trustedIntroducers.end() != it)
@@ -95,11 +98,14 @@
   // if data is sync data or chat data
   if(m_syncPrefixRegex->match(data->getName()) || m_chatDataPolicy->satisfy(*data))
     {
+      _LOG_DEBUG("Sync/Chat Data");
       Name keyName = IdentityCertificate::certificateNameToPublicKeyName(keyLocatorName);
+      _LOG_DEBUG("keyName: " << keyName.toUri());
 
       map<Name, Publickey>::const_iterator it = m_trustedIntroducers.find(keyName);
       if(m_trustedIntroducers.end() != it)
 	{
+          _LOG_DEBUG("Find trusted introducer!");
 	  if(verifySignature(*data, it->second))
 	    verifiedCallback(data);
 	  else
@@ -110,19 +116,21 @@
       it = m_trustedProducers.find(keyName);
       if(m_trustedProducers.end() != it)
 	{
+          _LOG_DEBUG("Find trusted producer!");
 	  if(verifySignature(*data, it->second))
 	    verifiedCallback(data);
 	  else
 	    unverifiedCallback(data);
 	  return NULL;
 	}
-      
+
+      _LOG_DEBUG("Did not find any trusted one!");
       return prepareRequest(keyName, false, data, stepCount, verifiedCallback, unverifiedCallback);
     }
   
   unverifiedCallback(data);
   return NULL;
-#endif
+// #endif
 }
 
 bool 
@@ -130,12 +138,14 @@
 				      const Name& certificateName)
 { 
 
-#ifdef _DEBUG
-  _LOG_DEBUG("checkSigningPolicy");
   return true;
-#else
-  return (m_syncPrefixRegex->match(dataName) && certificateName == m_signingCertificateName) ? true : false; 
-#endif
+
+// #ifdef _DEBUG
+//   _LOG_DEBUG("checkSigningPolicy");
+//   return true;
+// #else
+  // return (m_syncPrefixRegex->match(dataName) && certificateName.getPrefix(certificateName.size()-1) == m_signingCertificateName) ? true : false; 
+// #endif
 }
     
 Name 
@@ -145,6 +155,7 @@
 void
 SyncPolicyManager::addTrustAnchor(const IdentityCertificate& identityCertificate, bool isIntroducer)
 {
+  _LOG_DEBUG("Add intro/producer: " << identityCertificate.getPublicKeyName());
   if(isIntroducer)
     m_trustedIntroducers.insert(pair <Name, Publickey > (identityCertificate.getPublicKeyName(), identityCertificate.getPublicKeyInfo()));
   else
@@ -198,6 +209,11 @@
   interestPrefixName->append("WOT").append(keyName).append("INTRO-CERT");
 
   Ptr<const std::vector<ndn::Name> > nameList = getAllIntroducerName();
+  if(0 == nameList->size())
+    {
+      unverifiedCallback(data);
+      return NULL;
+    }
 
   Name interestName = *interestPrefixName;
   interestName.append(nameList->at(0));
@@ -206,6 +222,7 @@
     interestName.append("INTRODUCER");
 
   Ptr<Interest> interest = Ptr<Interest>(new Interest(interestName));
+  _LOG_DEBUG("send interest for intro cert: " << interest->getName());
   interest->setChildSelector(Interest::CHILD_RIGHT);
 
   DataCallback requestedCertVerifiedCallback = boost::bind(&SyncPolicyManager::onIntroCertVerified, 
diff --git a/src/sync-policy-manager.h b/src/sync-policy-manager.h
index 418abc7..fac9b4a 100644
--- a/src/sync-policy-manager.h
+++ b/src/sync-policy-manager.h
@@ -58,7 +58,7 @@
                   bool isIntroducer);
 
   inline void 
-  setWrapper(ndn::Wrapper* handler)
+  setWrapper(ndn::Ptr<ndn::Wrapper> handler)
   { m_handler = handler; }
 
 private:
@@ -118,7 +118,7 @@
   std::map<ndn::Name, ndn::security::Publickey> m_trustedProducers;
   std::map<ndn::Name, SpecificPolicyRule> m_chatDataRules;
 
-  ndn::Wrapper* m_handler;
+  ndn::Ptr<ndn::Wrapper> m_handler;
 };
 
 #endif
