diff --git a/src/endorse-certificate.cpp b/src/endorse-certificate.cpp
index c6d338a..8dd43e0 100644
--- a/src/endorse-certificate.cpp
+++ b/src/endorse-certificate.cpp
@@ -13,12 +13,14 @@
 #include <ndn.cxx/helpers/der/der.h>
 #include <ndn.cxx/helpers/der/visitor/simple-visitor.h>
 #include <ndn.cxx/security/certificate/certificate-subdescrpt.h>
-
+#include "logging.h"
 
 using namespace std;
 using namespace ndn;
 using namespace ndn::security;
 
+INIT_LOGGER("EndorseCertificate");
+
 ProfileExtension::ProfileExtension(const ProfileData & profileData)
   : CertificateExtension("1.3.6.1.5.32.2.1", true, *profileData.encodeToWire())
 {}
@@ -37,6 +39,7 @@
 Ptr<ProfileData>
 ProfileExtension::getProfileData()
 {
+  // _LOG_DEBUG("size: " << m_extnValue.size ());
   boost::iostreams::stream
     <boost::iostreams::array_source> is (m_extnValue.buf (), m_extnValue.size ());
   return Ptr<ProfileData>(new ProfileData(*Data::decodeFromWire(is)));
@@ -115,7 +118,7 @@
   setNotBefore(notBefore);
   setNotAfter(notAfter);
   addSubjectDescription(CertificateSubDescrypt("2.5.4.41", m_keyName.toUri()));
-  setPublicKeyInfo(kskCertificate.getPublicKeyInfo());
+  setPublicKeyInfo(kskCertificate.getPublicKeyInfo());  
   addExtension(ProfileExtension(*m_profileData));
   addExtension(EndorseExtension(m_endorseList));
   
@@ -161,9 +164,11 @@
 EndorseCertificate::EndorseCertificate(const Data& data)
   : Certificate(data)
 {
+  // _LOG_DEBUG("0");
   const Name& dataName = data.getName();
+  // _LOG_DEBUG("1");
   name::Component certFlag(string("PROFILE-CERT"));  
-
+  // _LOG_DEBUG("2");
   int profileIndex = -1;
   for(int i = 0; i < dataName.size(); i++)
     {
@@ -173,26 +178,35 @@
 	  break;
 	}
     }
-
+  // _LOG_DEBUG("3");
   if(profileIndex < 0)
     throw LnException("No PROFILE-CERT component in data name!");
 
   m_keyName = dataName.getSubName(0, profileIndex);
   m_signer = dataName.getSubName(profileIndex + 1, dataName.size() - profileIndex - 2);
 
+  // _LOG_DEBUG("keyName: " << m_keyName.toUri());
+  // _LOG_DEBUG("signer: " << m_signer.toUri());
+
   OID profileExtensionOID("1.3.6.1.5.32.2.1");
   OID endorseExtensionOID("1.3.6.1.5.32.2.2");
 
+  // _LOG_DEBUG("OID ready");
   ExtensionList::iterator it = m_extnList.begin();
   for(; it != m_extnList.end(); it++)
     {
+      // _LOG_DEBUG("entry");
       if(profileExtensionOID == it->getOID())
 	{
+          // _LOG_DEBUG("ProfileExtn");
           ProfileExtension profileExtension(*it);
+          // _LOG_DEBUG("ProfileExtn created");
 	  m_profileData = profileExtension.getProfileData();
+          // _LOG_DEBUG("get profileDate");
 	}
       if(endorseExtensionOID == it->getOID())
         {
+          // _LOG_DEBUG("EndorseExtn");
           EndorseExtension endorseExtension(*it);
           m_endorseList = endorseExtension.getEndorsedList();
         }
