diff --git a/src/addcontactpanel.cpp b/src/addcontactpanel.cpp
index bea8d7f..c5c80e4 100644
--- a/src/addcontactpanel.cpp
+++ b/src/addcontactpanel.cpp
@@ -12,7 +12,7 @@
 #include "ui_addcontactpanel.h"
 
 #ifndef Q_MOC_RUN
-#include <cryptopp/base64.h>
+// #include <cryptopp/base64.h>
 // #include <ndn.cxx/helpers/der/der.h>
 #include <ndn.cxx/helpers/der/visitor/simple-visitor.h>
 #include "logging.h"
@@ -125,7 +125,13 @@
 AddContactPanel::onAddClicked()
 {
   ContactItem contactItem(*m_currentEndorseCertificate);
-  m_contactManager->getContactStorage()->addContact(contactItem);
+  try{
+    m_contactManager->getContactStorage()->addContact(contactItem);
+  }catch(exception& e){
+    m_warningDialog->setMsg(e.what());
+    m_warningDialog->show();
+    return;
+  }
   emit newContactAdded();
   this->close();
 }
@@ -216,11 +222,9 @@
           Ptr<ContactItem> contact = m_contactManager->getContact(signerName);
           if(contact == NULL)
             continue;
-          _LOG_DEBUG("get contact: " << signerName.toUri());
 
           if(!contact->isIntroducer() || !contact->canBeTrustedFor(m_currentEndorseCertificate->getProfileData()->getIdentityName()))
             continue;
-          _LOG_DEBUG("contact can be trusted");
           
           if(!security::PolicyManager::verifySignature(*data, contact->getSelfEndorseCertificate().getPublicKeyInfo()))
             continue;
@@ -229,15 +233,10 @@
           if(profileBlob != tmpProfileBlob)
             continue;
 
-           _LOG_DEBUG("Profile equal");
-
           const vector<string>& endorseList = endorseCert->getEndorseList();
           vector<string>::const_iterator it = endorseList.begin();
           for(; it != endorseList.end(); it++)
-            {
-              _LOG_DEBUG("Entry: " << *it);
-              endorseCount[*it] += 1;
-            }
+            endorseCount[*it] += 1;
         }
     }
 
diff --git a/src/chatdialog.cpp b/src/chatdialog.cpp
index e0304a6..1e30f87 100644
--- a/src/chatdialog.cpp
+++ b/src/chatdialog.cpp
@@ -249,7 +249,7 @@
                                             dskCertificate.getPublicKeyInfo(),
                                             (isIntroducer ? SyncIntroCertificate::INTRODUCER : SyncIntroCertificate::PRODUCER));
   ndn::Name certName = m_identityManager->getDefaultCertificateNameByIdentity(m_defaultIdentity);
-  _LOG_DEBUG("publishIntroCert: " << syncIntroCertificate.getName());
+  _LOG_DEBUG("Publish Intro Certificate: " << syncIntroCertificate.getName());
   m_identityManager->signByCertificate(syncIntroCertificate, certName);
   m_handler->putToNdnd(*syncIntroCertificate.encodeToWire());
 }
@@ -257,14 +257,13 @@
 void
 ChatDialog::invitationRejected(const ndn::Name& identity)
 {
-  _LOG_DEBUG(" " << identity.toUri() << " rejected your invitation!");
-  //TODO:
+  _LOG_DEBUG(" " << identity.toUri() << " Rejected your invitation!");
 }
 
 void
 ChatDialog::invitationAccepted(const ndn::Name& identity, ndn::Ptr<ndn::Data> data, const string& inviteePrefix, bool isIntroducer)
 {
-  _LOG_DEBUG(" " << identity.toUri() << " accepted your invitation!");
+  _LOG_DEBUG(" " << identity.toUri() << " Accepted your invitation!");
   ndn::Ptr<const ndn::signature::Sha256WithRsa> sha256sig = boost::dynamic_pointer_cast<const ndn::signature::Sha256WithRsa> (data->getSignature());
   const ndn::Name & keyLocatorName = sha256sig->getKeyLocator().getKeyName();
   ndn::Ptr<ndn::security::IdentityCertificate> dskCertificate = m_invitationPolicyManager->getValidatedDskCertificate(keyLocatorName);
@@ -1018,7 +1017,6 @@
 ChatDialog::closeEvent(QCloseEvent *e)
 {
   hide();
-  _LOG_DEBUG("about to leave 1");
   emit closeChatDialog(m_chatroomPrefix);
 }
 
diff --git a/src/contact-manager.cpp b/src/contact-manager.cpp
index 71b9ea2..2b834c6 100644
--- a/src/contact-manager.cpp
+++ b/src/contact-manager.cpp
@@ -13,13 +13,10 @@
 #ifndef Q_MOC_RUN
 #include <ndn.cxx/wrapper/wrapper.h>
 #include <ndn.cxx/security/keychain.h>
-#include <ndn.cxx/security/identity/basic-identity-storage.h>
-#include <ndn.cxx/security/identity/osx-privatekey-storage.h>
 #include <ndn.cxx/security/policy/simple-policy-manager.h>
 #include <ndn.cxx/security/policy/identity-policy-rule.h>
-#include <ndn.cxx/security/cache/ttl-certificate-cache.h>
-#include <ndn.cxx/security/encryption/basic-encryption-manager.h>
 #include <ndn.cxx/helpers/der/der.h>
+#include <cryptopp/base64.h>
 #include <fstream>
 #include "logging.h"
 #endif
@@ -48,12 +45,10 @@
 void
 ContactManager::setKeychain()
 {
-  Ptr<OSXPrivatekeyStorage> privateStorage = Ptr<OSXPrivatekeyStorage>::Create();
-  Ptr<IdentityManager> identityManager = Ptr<IdentityManager>(new IdentityManager(Ptr<BasicIdentityStorage>::Create(), privateStorage));
-  Ptr<TTLCertificateCache> certificateCache = Ptr<TTLCertificateCache>(new TTLCertificateCache());
-  Ptr<SimplePolicyManager> policyManager = Ptr<SimplePolicyManager>(new SimplePolicyManager(10, certificateCache));
-  Ptr<EncryptionManager> encryptionManager = Ptr<EncryptionManager>(new BasicEncryptionManager(privateStorage, "/tmp/encryption.db"));
-  Ptr<Keychain> keychain = Ptr<Keychain>(new Keychain(identityManager, policyManager, encryptionManager));
+  Ptr<IdentityManager> identityManager = Ptr<IdentityManager>::Create();
+  Ptr<SimplePolicyManager> policyManager = Ptr<SimplePolicyManager>::Create();
+
+  Ptr<Keychain> keychain = Ptr<Keychain>(new Keychain(identityManager, policyManager, NULL));
 
   policyManager->addVerificationPolicyRule(Ptr<IdentityPolicyRule>(new IdentityPolicyRule("^([^<DNS>]*)<DNS><ENDORSED>",
                                                                                           "^([^<KEY>]*)<KEY>(<>*)[<ksk-.*><dsk-.*>]<ID-CERT>$",
@@ -75,20 +70,65 @@
                                                                                      "^([^<KEY>]*)<KEY>(<>*)<><ID-CERT>",
                                                                                      "==", "\\1", "\\1\\2", true)));
 
-  ifstream is ("trust-anchor.data", ios::binary);
-  is.seekg (0, ios::end);
-  ifstream::pos_type size = is.tellg();
-  char * memblock = new char [size];    
-  is.seekg (0, ios::beg);
-  is.read (memblock, size);
-  is.close();
+  const string TrustAnchor("BIICqgOyEIWlKzDI2xX2hdq5Azheu9IVyewcV4uM7ylfh67Y8MIxF3tDCTx5JgEn\
+HYMuCaYQm6XuaXTlVfDdWff/K7Xebq8IgGxjNBeU9eMf7Gy9iIMrRAOdBG0dBHmo\
+67biGs8F+P1oh1FwKu/FN1AE9vh8HSOJ94PWmjO+6PvITFIXuI3QbcCz8rhvbsfb\
+5X/DmfbJ8n8c4X3nVxrBm6fd4z8kOFOvvhgJImvqsow69Uy+38m8gJrmrcWMoPBJ\
+WsNLcEriZCt/Dlg7EqqVrIn6ukylKCvVrxA9vm/cEB74J/N+T0JyMRDnTLm17gpq\
+Gd75rhj+bLmpOMOBT7Nb27wUKq8gcXzeAADy+p1uZG4A+p1LRVkA+vVrc2stMTM4\
+MzMyNTcyMAD6vUlELUNFUlQA+q39PgurHgAAAaID4gKF5vjua9EIr3/Fn8k1AdSc\
+nEryjVDW3ikvYoSwjK7egTkAArq1BSc+C6sdAAHiAery+p1uZG4A+p1LRVkA+vVr\
+c2stMTM4MzMyNTcyMAD6vUlELUNFUlQAAAAAAAGaFr0wggFjMCIYDzIwMTMxMTAx\
+MTcxMTIyWhgPMjAxNDExMDExNzExMjJaMBkwFwYDVQQpExBORE4gVGVzdGJlZCBS\
+b290MIIBIDANBgkqhkiG9w0BAQEFAAOCAQ0AMIIBCAKCAQEA06x+elwzWCHa4I3b\
+yrYCMAIVxQpRVLuOXp0h+BS+5GNgMVPi7+40o4zSJG+kiU8CIH1mtj8RQAzBX9hF\
+I5VAyOC8nS8D8YOfBwt2yRDZPgt1E5PpyYUBiDYuq/zmJDL8xjxAlxrMzVOqD/uj\
+/vkkcBM/T1t9Q6p1CpRyq+GMRbV4EAHvH7MFb6bDrH9t8DHEg7NPUCaSQBrd7PvL\
+72P+QdiNH9zs/EiVzAkeMG4iniSXLuYM3z0gMqqcyUUUr6r1F9IBmDO+Kp97nZh8\
+VCL+cnIEwyzAFAupQH5GoXUWGiee8oKWwH2vGHX7u6sWZsCp15NMSG3OC4jUIZOE\
+iVUF1QIBEQAA");
 
-  Ptr<Blob> readBlob = Ptr<Blob>(new Blob(memblock, size));
-  Ptr<Data> readData = Data::decodeFromWire (readBlob);
-  Ptr<IdentityCertificate> anchor = Ptr<IdentityCertificate>(new IdentityCertificate(*readData));   
+  string decoded;
+  CryptoPP::StringSource ss(reinterpret_cast<const unsigned char *>(TrustAnchor.c_str()), 
+                            TrustAnchor.size(), 
+                            true,
+                            new CryptoPP::Base64Decoder(new CryptoPP::StringSink(decoded)));
+  Ptr<Blob> blob = Ptr<Blob>(new Blob(decoded.c_str(), decoded.size()));
+  Ptr<Data> data = Data::decodeFromWire(blob);
+  Ptr<IdentityCertificate>anchor = Ptr<IdentityCertificate>(new IdentityCertificate(*data));
   policyManager->addTrustAnchor(anchor);  
-  
-  delete memblock;
+
+#ifdef _DEBUG
+
+  const string FakeAnchor("BIICqgOyEIVAaoHnQZIx5osAuY2fKte4HBSrxyam7MY6/kp+w47O1bGdd2KjeZKV\
+zZzQd3EQorDC3KUPbB6ql30jYfspvo4OPSlIuDrkyROaoZ+MSKyzQYpB6CZcTjBa\
+qcWYFOfwUlcWvkbd00X4bkc5PkcWpVdRrx+NCTiq9EXes//hOHpEJHMNsJUi45O+\
+6M4OE6/sNEqs/ryHn2w1vCqwPpG8xzcd0prQUdCH2MGE77F+H0XFDuWp8mrT37Uw\
+DUy7Ltm+7nDTHSQy2J3Zk4Q+0tjxCzSw4owEpwOHr+afdkuE3v9aB2NRQBBDCEmL\
+Ykz4sYX3XE8MVFqRn1HHWCkszjDg+F0UAADy+p1uZG4A+p1LRVkA+vVrc2stMTM4\
+MjkzNDE5OAD6vUlELUNFUlQA+s39/////95rc7MAAAGiA+IChaK1eVvzlkg6BJAw\
+qiOpxRoezQ0hAHOBbPRLeBllxMN7AAK6tQUm3mtztQAB4gHq8vqdbmRuAPqdS0VZ\
+APr1a3NrLTEzODI5MzQxOTgA+r1JRC1DRVJUAAAAAAABmhblMIIBaDAiGA8yMDEz\
+MTAyODAwMDAwMFoYDzIwMzMxMDI4MDAwMDAwWjAcMBoGA1UEKRMTL25kbi9rc2st\
+MTM4MjkzNDE5ODCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAK2htIFF\
+/PH+SJsGOA6jhpFT74xfLJlgZNJOnKzl27HI2gupE0mainWj/HqVzdGxD6jOOReI\
+sul+eQyEyBYq4e35pLmdJGlux/+UPQ51DD8jg04GrUPewV7+iGm6usp/7xEGHbah\
+H2Grv/bsGrt6aRA8cKmdIc+rehxZCVFtiwSEHTnOWzn3lfZR5xnjF9aGX+uGo1hA\
+gMwu1ECxg4H3O4z1tbTzji5+WH0RDsPRlgzQX6wAQH8btlQyoFJfljEA3QaOtDaB\
+OcfegIlClzutmgJnK9i5ZLz2Mjvx49dlCWAVKg65vOXMLC/33jD9F+V8urwsBlOb\
+F7Wh5ayeo8NBKDsCAwEAAQAA");
+
+  string decoded2;
+  CryptoPP::StringSource ss2(reinterpret_cast<const unsigned char *>(FakeAnchor.c_str()), 
+                            FakeAnchor.size(), 
+                            true,
+                            new CryptoPP::Base64Decoder(new CryptoPP::StringSink(decoded2)));
+  Ptr<Blob> blob2 = Ptr<Blob>(new Blob(decoded2.c_str(), decoded2.size()));
+  Ptr<Data> data2 = Data::decodeFromWire(blob2);
+  Ptr<IdentityCertificate>anchor2 = Ptr<IdentityCertificate>(new IdentityCertificate(*data2));
+  policyManager->addTrustAnchor(anchor2);  
+
+#endif
 
   m_keychain = keychain;
 }
@@ -210,7 +250,7 @@
 void
 ContactManager::updateProfileData(const Name& identity)
 {
-  _LOG_DEBUG("updateProfileData: " << identity.toUri());
+  // _LOG_DEBUG("updateProfileData: " << identity.toUri());
   // Get current profile;
   Ptr<Profile> newProfile = m_contactStorage->getSelfProfile(identity);
   if(NULL == newProfile)
@@ -233,7 +273,7 @@
       // _LOG_DEBUG("Signing DONE!");
       if(NULL == newEndorseCertificate)
         return;
-      _LOG_DEBUG("About to update");
+      // _LOG_DEBUG("About to update");
       m_contactStorage->updateSelfEndorseCertificate(newEndorseCertificate, identity);
 
       publishSelfEndorseCertificateInDNS(newEndorseCertificate);
@@ -244,7 +284,7 @@
       // _LOG_DEBUG("Signing DONE!");
       if(NULL == newEndorseCertificate)
         return;
-      _LOG_DEBUG("About to Insert");
+      // _LOG_DEBUG("About to Insert");
       m_contactStorage->addSelfEndorseCertificate(newEndorseCertificate, identity);
 
       publishSelfEndorseCertificateInDNS(newEndorseCertificate);
@@ -278,6 +318,8 @@
 ContactManager::generateEndorseCertificate(const Name& identity, const Name& signerIdentity)
 {
   Ptr<ContactItem> contact = getContact(identity);
+  if(contact == NULL)
+    return NULL;
 
   Ptr<IdentityManager> identityManager = m_keychain->getIdentityManager();
   Name signerKeyName = identityManager->getDefaultKeyNameForIdentity(signerIdentity);
@@ -312,6 +354,9 @@
   identityManager->signByCertificate(*profileData, certificateName);
 
   Ptr<security::IdentityCertificate> signingCert = identityManager->getCertificate(certificateName);
+  if(NULL == signingCert)
+    return NULL;
+
   Name signingKeyName = security::IdentityCertificate::certificateNameToPublicKeyName(signingCert->getName(), true);
 
   Ptr<security::IdentityCertificate> kskCert;
@@ -319,20 +364,21 @@
     {
       Ptr<const signature::Sha256WithRsa> dskCertSig = DynamicCast<const signature::Sha256WithRsa>(signingCert->getSignature());
       // HACK! KSK certificate should be retrieved from network.
-      _LOG_DEBUG("keyLocator: " << dskCertSig->getKeyLocator().getKeyName());
       Name keyName = security::IdentityCertificate::certificateNameToPublicKeyName(dskCertSig->getKeyLocator().getKeyName());
-      _LOG_DEBUG("keyName: " << keyName.toUri());
+
       Name kskCertName = identityManager->getPublicStorage()->getDefaultCertificateNameForKey(keyName);
-      _LOG_DEBUG("ksk cert name: " << kskCertName);
+
       kskCert = identityManager->getCertificate(kskCertName);
 
     }
   else
     {
       kskCert = signingCert;
-      _LOG_DEBUG("ksk cert name: " << kskCert->getName().toUri());
     }
 
+  if(NULL == kskCert)
+    return NULL;
+
   vector<string> endorseList;
   Profile::const_iterator it = profile.begin();
   for(; it != profile.end(); it++)
@@ -359,18 +405,9 @@
   const security::Publickey& ksk = selfEndorseCertificate->getPublicKeyInfo();
 
   if(security::PolicyManager::verifySignature(*plainData, ksk))
-    {
-      // Profile profile = selfEndorseCertificate->getProfileData()->getProfile();
-      // Profile::const_iterator it = profile.getEntries().begin();
-      // it++;
-      // _LOG_DEBUG("Entry Size: " << it->first);
-
-      emit contactFetched (*selfEndorseCertificate); 
-    }
+    emit contactFetched (*selfEndorseCertificate); 
   else
-    {
-      emit contactFetchFailed (identity);
-    }
+    emit contactFetchFailed (identity);
 }
 
 void
@@ -396,11 +433,6 @@
   data->setName(dnsName);
   Ptr<Blob> blob = selfEndorseCertificate->encodeToWire();
 
-  // string encoded;
-  // CryptoPP::StringSource ss(reinterpret_cast<const unsigned char *>(blob->buf()), blob->size(), true,
-  //       		    new CryptoPP::Base64Encoder(new CryptoPP::StringSink(encoded), false));
-
-  // Content content(encoded.c_str(), encoded.size());
   Content content(blob->buf(), blob->size());
   data->setContent(content);
 
diff --git a/src/contact-storage.cpp b/src/contact-storage.cpp
index 903f210..b3ee977 100644
--- a/src/contact-storage.cpp
+++ b/src/contact-storage.cpp
@@ -288,7 +288,6 @@
 Ptr<Profile>
 ContactStorage::getSelfProfile(const Name& identity)
 {
-  _LOG_DEBUG("getSelfProfile " << identity.toUri());
   sqlite3_stmt *stmt;
   Ptr<Profile> profile = Ptr<Profile>(new Profile(identity));
   
@@ -297,13 +296,14 @@
 
   while(sqlite3_step (stmt) == SQLITE_ROW)
     {
-      _LOG_DEBUG("entry");
       string profileType(reinterpret_cast<const char *>(sqlite3_column_text(stmt, 0)), sqlite3_column_bytes (stmt, 0));
       Blob profileValue(reinterpret_cast<const char *>(sqlite3_column_text(stmt, 1)), sqlite3_column_bytes (stmt, 1));
 
       profile->setProfileEntry(profileType, profileValue );
     }
 
+  sqlite3_finalize(stmt);
+
   return profile;
 }
   
@@ -329,7 +329,6 @@
   sqlite3_bind_int(stmt, 4, (isIntroducer ? 1 : 0));
 
   int res = sqlite3_step (stmt);
-  // _LOG_DEBUG("res " << res);
   sqlite3_finalize (stmt);
 
   Ptr<ProfileData> profileData = contact.getSelfEndorseCertificate().getProfileData();
@@ -509,6 +508,8 @@
       profile->setProfileEntry(profileType, profileValue);
     }
 
+  sqlite3_finalize(stmt);
+
   return profile;
 }
 
@@ -653,8 +654,6 @@
       Ptr<Blob> blob = endorseCertificate.encodeToWire();
       sqlite3_bind_text(stmt, 4, blob->buf(), blob->size(), SQLITE_TRANSIENT);
       int res = sqlite3_step (stmt);
-      // if(res != SQLITE_OK)
-      //   _LOG_DEBUG("Insert CollectEndorse Failure: " << getCertName.toUri());
       sqlite3_finalize (stmt); 
       return;
     }
@@ -667,8 +666,6 @@
       sqlite3_bind_text(stmt, 3, endorserName.toUri().c_str(), endorserName.toUri().size(), SQLITE_TRANSIENT);
       sqlite3_bind_text(stmt, 4, endorseeName.toUri().c_str(), endorseeName.toUri().size(), SQLITE_TRANSIENT);
       int res = sqlite3_step (stmt);
-      // if(res != SQLITE_OK)
-      //   _LOG_DEBUG("Insert CollectEndorse Failure: " << getCertName.toUri());
       sqlite3_finalize (stmt); 
       return;
     }
@@ -689,5 +686,7 @@
       collectEndorseList->push_back(blob);
     }
 
+  sqlite3_finalize (stmt);
+
   return collectEndorseList;
 }
diff --git a/src/contactpanel.cpp b/src/contactpanel.cpp
index 8775ae5..de35f51 100644
--- a/src/contactpanel.cpp
+++ b/src/contactpanel.cpp
@@ -558,6 +558,10 @@
 ContactPanel::startChatroom(const QString& chatroom, const QString& invitee, bool isIntroducer)
 {
   Name chatroomName(chatroom.toUtf8().constData());
+
+  Name inviteeNamespace(invitee.toStdString());
+  Ptr<ContactItem> inviteeItem = m_contactManager->getContact(inviteeNamespace);
+
   ChatDialog* chatDialog = new ChatDialog(m_contactManager, chatroomName, m_localPrefix, m_defaultIdentity, m_nickName);
   m_chatDialogs.insert(pair <Name, ChatDialog*> (chatroomName, chatDialog));
 
@@ -565,9 +569,6 @@
           this, SLOT(removeChatDialog(const ndn::Name&)));
 
   // send invitation
-  Name inviteeNamespace(invitee.toUtf8().constData());
-  Ptr<ContactItem> inviteeItem = m_contactManager->getContact(inviteeNamespace);
-
   chatDialog->sendInvitation(inviteeItem, isIntroducer); 
   
   chatDialog->show();
@@ -578,8 +579,11 @@
 ContactPanel::startChatroom2(const ChronosInvitation& invitation, 
                              const security::IdentityCertificate& identityCertificate)
 {
+  Ptr<ContactItem> inviterItem = m_contactManager->getContact(invitation.getInviterNameSpace());
+
   Name chatroomName("/ndn/broadcast/chronos");
   chatroomName.append(invitation.getChatroom());
+
   ChatDialog* chatDialog = new ChatDialog(m_contactManager, chatroomName, m_localPrefix, m_defaultIdentity, m_nickName, true);
 
   connect(chatDialog, SIGNAL(closeChatDialog(const ndn::Name&)),
@@ -588,7 +592,6 @@
   chatDialog->addChatDataRule(invitation.getInviterPrefix(), identityCertificate, true);
   chatDialog->publishIntroCert(identityCertificate, true);
 
-  Ptr<ContactItem> inviterItem = m_contactManager->getContact(invitation.getInviterNameSpace());
   chatDialog->addTrustAnchor(inviterItem->getSelfEndorseCertificate());
   
   m_chatDialogs.insert(pair <Name, ChatDialog*> (chatroomName, chatDialog));
diff --git a/src/main.cpp b/src/main.cpp
index 4e58e77..44a67ee 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -53,10 +53,16 @@
 
   // app.setWindowIcon(QIcon(":/demo.icns"));
 
-  Ptr<ContactStorage> contactStorage = Ptr<ContactStorage>::Create();
+  Ptr<ContactStorage> contactStorage = NULL;
+  try{
+    contactStorage = Ptr<ContactStorage>::Create();
+  }catch(std::exception& e){
+    std::cerr << e.what() << std::endl;
+    exit(1);
+  }
   Ptr<DnsStorage> dnsStorage = Ptr<DnsStorage>::Create();
   Ptr<ContactManager> contactManager = Ptr<ContactManager>(new ContactManager(contactStorage, dnsStorage));
-
+  
   ContactPanel contactPanel(contactManager);
 
   contactPanel.show ();
