diff --git a/src/panel-policy-manager.cpp b/src/panel-policy-manager.cpp
index 1bbd849..679a3c9 100644
--- a/src/panel-policy-manager.cpp
+++ b/src/panel-policy-manager.cpp
@@ -82,10 +82,9 @@
 						 const DataCallback& verifiedCallback,
 						 const UnverifiedCallback& unverifiedCallback)
 {
-  _LOG_DEBUG("checkVerificationPolicy");
   if(m_stepLimit == stepCount)
     {
-      _LOG_DEBUG("reach the maximum steps of verification");
+      _LOG_ERROR("Reach the maximum steps of verification!");
       unverifiedCallback(data);
       return NULL;
     }
@@ -94,6 +93,7 @@
 
   if(KeyLocator::KEYNAME != sha256sig->getKeyLocator().getType())
     {
+      _LOG_ERROR("Keylocator is not name!");
       unverifiedCallback(data);
       return NULL;
     }
@@ -102,9 +102,7 @@
 
   if(m_kskRegex->match(data->getName()))
     {
-      _LOG_DEBUG("is ksk");
       Name keyName = m_kskRegex->expand();
-      _LOG_DEBUG("ksk name: " << keyName.toUri());
       map<Name, Publickey>::iterator it = m_trustAnchors.find(keyName);
       if(m_trustAnchors.end() != it)
         {
@@ -112,7 +110,6 @@
           Ptr<IdentityCertificate> identityCertificate = Ptr<IdentityCertificate>(new IdentityCertificate(*data));
           if(it->second.getKeyBlob() == identityCertificate->getPublicKeyInfo().getKeyBlob())
             {
-              _LOG_DEBUG("same key!");
               verifiedCallback(data);
             }
           else
@@ -140,13 +137,10 @@
       return NULL;	
     }
 
-  _LOG_DEBUG("KEY Locator: " << keyLocatorName.toUri());
   if(m_endorseeRule->satisfy(*data))
     {
       m_keyNameRegex->match(keyLocatorName);
       Name keyName = m_keyNameRegex->expand();
-      _LOG_DEBUG("data name: " << data->getName());
-      _LOG_DEBUG("keyName: " << keyName.toUri());
       if(m_trustAnchors.end() != m_trustAnchors.find(keyName))
         if(verifySignature(*data, m_trustAnchors[keyName]))
           verifiedCallback(data);
@@ -164,26 +158,6 @@
   return NULL;
 }
 
-// void 
-// PanelPolicyManager::onCertificateVerified(Ptr<Data> certData, 
-// 					       Ptr<Data> originalData,
-// 					       const DataCallback& verifiedCallback, 
-// 					       const UnverifiedCallback& unverifiedCallback)
-// {
-//   IdentityCertificate certificate(*certData);
-
-//   if(verifySignature(*originalData, certificate.getPublicKeyInfo()))
-//     verifiedCallback(originalData);
-//   else
-//     unverifiedCallback(originalData);
-// }
-
-// void
-// PanelPolicyManager::onCertificateUnverified(Ptr<Data> certData, 
-// 						 Ptr<Data> originalData,
-// 						 const UnverifiedCallback& unverifiedCallback)
-// { unverifiedCallback(originalData); }
-
 bool 
 PanelPolicyManager::checkSigningPolicy(const Name & dataName, const Name & certificateName)
 {
@@ -202,6 +176,6 @@
 void
 PanelPolicyManager::addTrustAnchor(const EndorseCertificate& selfEndorseCertificate)
 { 
-  _LOG_DEBUG(selfEndorseCertificate.getPublicKeyName().toUri());
+  // _LOG_DEBUG("Add Anchor: " << selfEndorseCertificate.getPublicKeyName().toUri());
   m_trustAnchors.insert(pair <Name, Publickey > (selfEndorseCertificate.getPublicKeyName(), selfEndorseCertificate.getPublicKeyInfo())); 
 }
