diff --git a/src/contact-storage.cpp b/src/contact-storage.cpp
index 8026644..21fcf51 100644
--- a/src/contact-storage.cpp
+++ b/src/contact-storage.cpp
@@ -13,6 +13,9 @@
 
 #include <string>
 #include <boost/filesystem.hpp>
+#include <ndn.cxx/fields/signature-sha256-with-rsa.h>
+#include <ndn.cxx/security/exception.h>
+#include <ndn.cxx/helpers/der/exception.h>
 #include "logging.h"
 
 using namespace std;
@@ -365,7 +368,6 @@
 void
 ContactStorage::updateProfileData(const Name& identity) const
 {
-   _LOG_DEBUG("Enter updateProfileData!");
   // Get current profile;
   Ptr<Profile> newProfile = getSelfProfile(identity);
   if(NULL == newProfile)
@@ -381,39 +383,41 @@
     {
       sqlite3_finalize (stmt);
 
-      Ptr<ProfileData> newProfileData = getSignedSelfProfileData(identity, *newProfile);
+      Ptr<EndorseCertificate> newEndorseCertificate = getSignedSelfEndorseCertificate(identity, *newProfile);
       _LOG_DEBUG("Signing DONE!");
-      if(NULL == newProfileData)
+      if(NULL == newEndorseCertificate)
         return;
-      Ptr<Blob> newProfileDataBlob = newProfileData->encodeToWire();
+      Ptr<Blob> newEndorseCertificateBlob = newEndorseCertificate->encodeToWire();
 
       _LOG_DEBUG("Before Inserting!");
 
       sqlite3_prepare_v2 (m_db, "INSERT INTO ProfileData (identity, profile_data) values (?, ?)", -1, &stmt, 0);
       sqlite3_bind_text(stmt, 1, identity.toUri().c_str(), identity.toUri().size(), SQLITE_TRANSIENT);
-      sqlite3_bind_text(stmt, 2, newProfileDataBlob->buf(), newProfileDataBlob->size(), SQLITE_TRANSIENT);
+      sqlite3_bind_text(stmt, 2, newEndorseCertificateBlob->buf(), newEndorseCertificateBlob->size(), SQLITE_TRANSIENT);
       sqlite3_step(stmt);
     }
   else
     {
       Ptr<Blob> profileDataBlob = Ptr<Blob>(new Blob(reinterpret_cast<const char *>(sqlite3_column_text(stmt, 0)), sqlite3_column_bytes (stmt, 0)));
       Ptr<Data> plainData = Data::decodeFromWire(profileDataBlob);
-      const Blob& oldProfileBlob = plainData->content();
+      EndorseCertificate oldEndorseCertificate(*plainData);    
+      // _LOG_DEBUG("Certificate converted!");
+      const Blob& oldProfileBlob = oldEndorseCertificate.getProfileData()->content();
       sqlite3_finalize (stmt);
 
       if(oldProfileBlob == *newProfileBlob)
         return;
 
-      Ptr<ProfileData> newProfileData = getSignedSelfProfileData(identity, *newProfile);
+      Ptr<EndorseCertificate> newEndorseCertificate = getSignedSelfEndorseCertificate(identity, *newProfile);
       _LOG_DEBUG("Signing DONE!");
-      if(NULL == newProfileData)
+      if(NULL == newEndorseCertificate)
         return;
-      Ptr<Blob> newProfileDataBlob = newProfileData->encodeToWire();
+      Ptr<Blob> newEndorseCertificateBlob = newEndorseCertificate->encodeToWire();
 
       _LOG_DEBUG("Before Updating!");
 
       sqlite3_prepare_v2 (m_db, "UPDATE ProfileData SET profile_data=? WHERE identity=?", -1, &stmt, 0);
-      sqlite3_bind_text(stmt, 1, newProfileDataBlob->buf(), newProfileDataBlob->size(), SQLITE_TRANSIENT);
+      sqlite3_bind_text(stmt, 1, newEndorseCertificateBlob->buf(), newEndorseCertificateBlob->size(), SQLITE_TRANSIENT);
       sqlite3_bind_text(stmt, 2, identity.toUri().c_str(), identity.toUri().size(), SQLITE_TRANSIENT);
       sqlite3_step(stmt);
     }
@@ -437,19 +441,33 @@
   return profile;
 }
 
-Ptr<ProfileData>
-ContactStorage::getSignedSelfProfileData(const Name& identity,
-                         const Profile& profile) const
+Ptr<EndorseCertificate>
+ContactStorage::getSignedSelfEndorseCertificate(const Name& identity,
+                                                const Profile& profile) const
 {
   Name certificateName = m_identityManager->getDefaultCertificateNameByIdentity(identity);
   if(0 == certificateName.size())
     return NULL;
 
   Ptr<ProfileData> profileData = Ptr<ProfileData>(new ProfileData(identity, profile));
-  _LOG_DEBUG("Get ProfileData, size: " << profileData->content().size());
-  _LOG_DEBUG("Get SigningCert, name: " << certificateName.toUri());
   m_identityManager->signByCertificate(*profileData, certificateName);
 
-  return profileData;
+  Ptr<security::IdentityCertificate> dskCert = m_identityManager->getCertificate(certificateName);
+  Ptr<const signature::Sha256WithRsa> dskCertSig = boost::dynamic_pointer_cast<const signature::Sha256WithRsa>(dskCert->getSignature());
+  Ptr<security::IdentityCertificate> kskCert = m_identityManager->getCertificate(dskCertSig->getKeyLocator().getKeyName());
+
+  vector<string> endorseList;
+  Profile::const_iterator it = profile.begin();
+  for(; it != profile.end(); it++)
+    endorseList.push_back(it->first);
+  
+  Ptr<EndorseCertificate> selfEndorseCertificate = Ptr<EndorseCertificate>(new EndorseCertificate(*kskCert,
+                                                                                                  kskCert->getNotBefore(),
+                                                                                                  kskCert->getNotAfter(),
+                                                                                                  profileData,
+                                                                                                  endorseList));
+  m_identityManager->signByCertificate(*selfEndorseCertificate, kskCert->getName());
+
+  return selfEndorseCertificate;
 }
 
diff --git a/src/contact-storage.h b/src/contact-storage.h
index 5b87146..7fc3171 100644
--- a/src/contact-storage.h
+++ b/src/contact-storage.h
@@ -14,7 +14,7 @@
 #include <sqlite3.h>
 #include "trusted-contact.h"
 #include "contact-item.h"
-#include "profile-data.h"
+#include "endorse-certificate.h"
 #include <ndn.cxx/security/identity/identity-manager.h>
 #include <ndn.cxx/fields/signature-sha256-with-rsa.h>
 
@@ -68,9 +68,9 @@
   ndn::Ptr<Profile>
   getSelfProfile(const ndn::Name& identity) const;
 
-  ndn::Ptr<ProfileData>
-  getSignedSelfProfileData(const ndn::Name& identity,
-                           const Profile& profile) const;
+  ndn::Ptr<EndorseCertificate>
+  getSignedSelfEndorseCertificate(const ndn::Name& identity,
+                                  const Profile& profile) const;
   
 private:
   ndn::Ptr<ndn::security::IdentityManager> m_identityManager;
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();
         }
diff --git a/src/profile-data.cpp b/src/profile-data.cpp
index b779adc..f057a6d 100644
--- a/src/profile-data.cpp
+++ b/src/profile-data.cpp
@@ -11,10 +11,14 @@
 #include "profile-data.h"
 #include "exception.h"
 #include <ndn.cxx/fields/signature-sha256-with-rsa.h>
+#include "logging.h"
+
 
 using namespace ndn;
 using namespace std;
 
+INIT_LOGGER("ProfileData");
+
 ProfileData::ProfileData(const Name& identity,
 			 const Profile& profile)
   : Data()
@@ -57,6 +61,7 @@
 ProfileData::ProfileData(const Data& data)
   : Data()
 {
+  // _LOG_DEBUG("ProfileData constructor");
   const Name& dataName = data.getName();
   name::Component appFlag(string("PROFILE"));  
 
@@ -90,6 +95,7 @@
   setSignature(newSig);
   setContent(data.getContent());
   setSignedBlob(newSignedBlob);
-
+  // _LOG_DEBUG("Decode Profile");
   m_profile = *Profile::fromDerBlob(data.content());
+  // _LOG_DEBUG("Profile Decoded");
 }
diff --git a/src/profile.cpp b/src/profile.cpp
index 7f2ba6e..e5c5325 100644
--- a/src/profile.cpp
+++ b/src/profile.cpp
@@ -10,11 +10,14 @@
 
 #include "profile.h"
 #include <ndn.cxx/helpers/der/der.h>
+#include <ndn.cxx/helpers/der/visitor/print-visitor.h>
 #include <ndn.cxx/helpers/der/visitor/simple-visitor.h>
+#include "logging.h"
 
 using namespace std;
 using namespace ndn;
 
+INIT_LOGGER("Profile");
 Profile::Profile(const Name& identityName)
   : m_identityName(identityName)
 {
@@ -91,7 +94,6 @@
     <boost::iostreams::array_source> is (derBlob.buf(), derBlob.size());
 
   Ptr<der::DerSequence> root = DynamicCast<der::DerSequence>(der::DerNode::parse(reinterpret_cast<InputIterator &>(is)));
-  
   const der::DerNodePtrList & children = root->getChildren();
   der::SimpleVisitor simpleVisitor;
   string identityName = boost::any_cast<string>(children[0]->accept(simpleVisitor));
@@ -100,7 +102,7 @@
   for(int i = 1; i < children.size(); i++)
     {
       Ptr<der::DerSequence> entry = DynamicCast<der::DerSequence>(children[i]);
-      const der::DerNodePtrList & tuple = root->getChildren();
+      const der::DerNodePtrList & tuple = entry->getChildren();
       string type = boost::any_cast<string>(tuple[0]->accept(simpleVisitor));
       Ptr<Blob> value = boost::any_cast<Ptr<Blob> >(tuple[1]->accept(simpleVisitor));
       profile->setProfileEntry(type, *value);
