diff --git a/src/chatdialog.cpp b/src/chatdialog.cpp
index f56ccc0..e0304a6 100644
--- a/src/chatdialog.cpp
+++ b/src/chatdialog.cpp
@@ -78,6 +78,9 @@
   m_rosterModel = new QStringListModel(this);
   ui->listView->setModel(m_rosterModel);
 
+  createActions();
+  createTrayIcon();
+
   m_timer = new QTimer(this);
 
   setWrapper(trial);
@@ -98,114 +101,33 @@
           this, SLOT(replot()));
   connect(m_scene, SIGNAL(replot()), 
           this, SLOT(replot()));
-  // TODO: TrayIcon
-  // connect(trayIcon, SIGNAL(messageClicked()), 
-  //         this, SLOT(showNormal()));
-  // connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), 
-  //         this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));
+  connect(trayIcon, SIGNAL(messageClicked()), 
+          this, SLOT(showNormal()));
+  connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), 
+          this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));
   connect(m_scene, SIGNAL(rosterChanged(QStringList)), 
           this, SLOT(updateRosterList(QStringList)));
 
-  // m_identityManager = ndn::Ptr<ndn::security::IdentityManager>::Create();
-  // // ndn::Ptr<ndn::security::EncryptionManager> encryptionManager = ndn::Ptr<ndn::security::EncryptionManager>(new ndn::security::BasicEncryptionManager(privateStorage, "/tmp/encryption.db"));
-
-  // ndn::Name certificateName = m_identityManager->getDefaultCertificateNameByIdentity(m_defaultIdentity);
-  // m_syncPolicyManager = ndn::Ptr<SyncPolicyManager>(new SyncPolicyManager(m_defaultIdentity, certificateName, m_chatroomPrefix));
 
   initializeSync();
 }
 
-// ChatDialog::ChatDialog(const ndn::Name& chatroomPrefix,
-// 		       const ndn::Name& localPrefix,
-//                        const ndn::Name& defaultIdentity,
-//                        const ndn::security::IdentityCertificate& identityCertificate,
-// 		       QWidget *parent) 
-//     : QDialog(parent)
-//     , ui(new Ui::ChatDialog)
-//     , m_chatroomPrefix(chatroomPrefix)
-//     , m_localPrefix(localPrefix)
-//     , m_defaultIdentity(defaultIdentity)
-//     , m_invitationPolicyManager(ndn::Ptr<InvitationPolicyManager>(new InvitationPolicyManager(m_chatroomPrefix.get(-1).toUri())))
-
-//     , m_sock(NULL)
-//     , m_lastMsgTime(0)
-//     // , m_historyInitialized(false)
-//     , m_joined(false)
-// {
-//   qRegisterMetaType<std::vector<Sync::MissingDataInfo> >("std::vector<Sync::MissingDataInfo>");
-//   qRegisterMetaType<size_t>("size_t");
-
-//   ui->setupUi(this);
-
-//   m_localChatPrefix = m_localPrefix;
-//   m_localChatPrefix.append("FH").append(m_defaultIdentity);
-//   m_localChatPrefix.append("chronos").append(m_chatroomPrefix.get(-1));
-
-//   m_session = time(NULL);
-//   m_scene = new DigestTreeScene(this);
-
-//   initializeSetting();
-//   updateLabels();
-
-//   ui->treeViewer->setScene(m_scene);
-//   ui->treeViewer->hide();
-//   m_scene->plot("Empty");
-//   QRectF rect = m_scene->itemsBoundingRect();
-//   m_scene->setSceneRect(rect);
-
-//   m_rosterModel = new QStringListModel(this);
-//   ui->listView->setModel(m_rosterModel);
-
-//   m_timer = new QTimer(this);
-
-//   setWrapper();
-
-//   connect(ui->lineEdit, SIGNAL(returnPressed()), 
-//           this, SLOT(returnPressed()));
-//   connect(ui->treeButton, SIGNAL(pressed()), 
-//           this, SLOT(treeButtonPressed()));
-//   connect(this, SIGNAL(dataReceived(QString, const char *, size_t, bool, bool)), 
-//           this, SLOT(processData(QString, const char *, size_t, bool, bool)));
-//   connect(this, SIGNAL(treeUpdated(const std::vector<Sync::MissingDataInfo>)), 
-//           this, SLOT(processTreeUpdate(const std::vector<Sync::MissingDataInfo>)));
-//   connect(m_timer, SIGNAL(timeout()), 
-//           this, SLOT(replot()));
-//   connect(m_scene, SIGNAL(replot()), 
-//           this, SLOT(replot()));
-//   // TODO: TrayIcon
-//   // connect(trayIcon, SIGNAL(messageClicked()), 
-//   //         this, SLOT(showNormal()));
-//   // connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), 
-//   //         this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));
-//   connect(m_scene, SIGNAL(rosterChanged(QStringList)), 
-//           this, SLOT(updateRosterList(QStringList)));
-
-//   // m_identityManager = ndn::Ptr<ndn::security::IdentityManager>::Create();
-//   // // ndn::Ptr<ndn::security::EncryptionManager> encryptionManager = ndn::Ptr<ndn::security::EncryptionManager>(new ndn::security::BasicEncryptionManager(privateStorage, "/tmp/encryption.db"));
-
-//   // ndn::Name certificateName = m_identityManager->getDefaultCertificateNameByIdentity(m_defaultIdentity);
-//   // m_syncPolicyManager = ndn::Ptr<SyncPolicyManager>(new SyncPolicyManager(m_defaultIdentity, certificateName, m_chatroomPrefix));
-
-//   initializeSync();
-// }
 
 ChatDialog::~ChatDialog()
 {
-  _LOG_DEBUG("about to leave 4!");
   if(m_sock != NULL)
     {
       sendLeave();
       delete m_sock;
       m_sock = NULL;
     }
-  // m_handler->shutdown();
+  m_handler->shutdown();
 }
 
 void
 ChatDialog::setWrapper(bool trial)
 {
   m_identityManager = ndn::Ptr<ndn::security::IdentityManager>::Create();
-  // ndn::Ptr<ndn::security::EncryptionManager> encryptionManager = ndn::Ptr<ndn::security::EncryptionManager>(new ndn::security::BasicEncryptionManager(privateStorage, "/tmp/encryption.db"));
 
   ndn::Name certificateName = m_identityManager->getDefaultCertificateNameByIdentity(m_defaultIdentity);
   m_syncPolicyManager = ndn::Ptr<SyncPolicyManager>(new SyncPolicyManager(m_defaultIdentity, certificateName, m_chatroomPrefix));
@@ -235,7 +157,6 @@
 void
 ChatDialog::initializeSetting()
 {
-  // TODO: nick name may be changed.
   m_user.setNick(QString::fromStdString(m_nick));
   m_user.setChatroom(QString::fromStdString(m_chatroomPrefix.get(-1).toUri()));
   m_user.setOriginPrefix(QString::fromStdString(m_localPrefix.toUri()));
@@ -288,7 +209,6 @@
   interestName.append(sigBits.buf(), sigBits.size());
   interestName.appendVersion();
 
-
   ndn::Ptr<ndn::Interest> interest = ndn::Ptr<ndn::Interest>(new ndn::Interest(interestName));
   ndn::Ptr<ndn::Closure> closure = ndn::Ptr<ndn::Closure>(new ndn::Closure(boost::bind(&ChatDialog::onInviteReplyVerified,
                                                                                        this,
@@ -319,14 +239,14 @@
 { m_syncPolicyManager->addChatDataRule(prefix, identityCertificate, isIntroducer); }
 
 void
-ChatDialog::publishIntroCert(ndn::Ptr<ndn::security::IdentityCertificate> dskCertificate, bool isIntroducer)
+ChatDialog::publishIntroCert(const ndn::security::IdentityCertificate& dskCertificate, bool isIntroducer)
 {
   SyncIntroCertificate syncIntroCertificate(m_chatroomPrefix,
-                                            dskCertificate->getPublicKeyName(),
+                                            dskCertificate.getPublicKeyName(),
                                             m_identityManager->getDefaultKeyNameForIdentity(m_defaultIdentity),
-                                            dskCertificate->getNotBefore(),
-                                            dskCertificate->getNotAfter(),
-                                            dskCertificate->getPublicKeyInfo(),
+                                            dskCertificate.getNotBefore(),
+                                            dskCertificate.getNotAfter(),
+                                            dskCertificate.getPublicKeyInfo(),
                                             (isIntroducer ? SyncIntroCertificate::INTRODUCER : SyncIntroCertificate::PRODUCER));
   ndn::Name certName = m_identityManager->getDefaultCertificateNameByIdentity(m_defaultIdentity);
   _LOG_DEBUG("publishIntroCert: " << syncIntroCertificate.getName());
@@ -349,7 +269,7 @@
   const ndn::Name & keyLocatorName = sha256sig->getKeyLocator().getKeyName();
   ndn::Ptr<ndn::security::IdentityCertificate> dskCertificate = m_invitationPolicyManager->getValidatedDskCertificate(keyLocatorName);
   m_syncPolicyManager->addChatDataRule(inviteePrefix, *dskCertificate, isIntroducer);
-  publishIntroCert(dskCertificate, isIntroducer);
+  publishIntroCert(*dskCertificate, isIntroducer);
 }
 
 void 
@@ -775,6 +695,83 @@
 }
 
 void
+ChatDialog::iconActivated(QSystemTrayIcon::ActivationReason reason)
+{
+  switch (reason)
+  {
+  case QSystemTrayIcon::Trigger:
+  case QSystemTrayIcon::DoubleClick:
+    break;
+  case QSystemTrayIcon::MiddleClick:
+    // showMessage();
+    break;
+  default:;
+  }
+}
+
+
+void
+ChatDialog::messageClicked()
+{
+  this->showMaximized();
+}
+
+
+void
+ChatDialog::createActions()
+{
+  // minimizeAction = new QAction(tr("Mi&nimize"), this);
+  // connect(minimizeAction, SIGNAL(triggered()), this, SLOT(hide()));
+
+  // maximizeAction = new QAction(tr("Ma&ximize"), this);
+  // connect(maximizeAction, SIGNAL(triggered()), this, SLOT(showMaximized()));
+
+  // restoreAction = new QAction(tr("&Restore"), this);
+  // connect(restoreAction, SIGNAL(triggered()), this, SLOT(showNormal()));
+
+  // settingsAction = new QAction(tr("Settings"), this);
+  // connect (settingsAction, SIGNAL(triggered()), this, SLOT(buttonPressed()));
+
+  // settingsAction->setMenuRole (QAction::PreferencesRole);
+
+  // updateLocalPrefixAction = new QAction(tr("Update local prefix"), this);
+  // connect (updateLocalPrefixAction, SIGNAL(triggered()), this, SLOT(updateLocalPrefix()));
+
+  // quitAction = new QAction(tr("Quit"), this);
+  // connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
+}
+
+void
+ChatDialog::createTrayIcon()
+{
+  // trayIconMenu = new QMenu(this);
+  // trayIconMenu->addAction(minimizeAction);
+  // trayIconMenu->addAction(maximizeAction);
+  // trayIconMenu->addAction(restoreAction);
+  // trayIconMenu->addSeparator();
+  // trayIconMenu->addAction(settingsAction);
+  // trayIconMenu->addSeparator();
+  // trayIconMenu->addAction(updateLocalPrefixAction);
+  // trayIconMenu->addSeparator();
+  // trayIconMenu->addAction(quitAction);
+
+  trayIcon = new QSystemTrayIcon(this);
+  // trayIcon->setContextMenu(trayIconMenu);
+
+  QIcon icon(":/images/icon_small.png");
+  trayIcon->setIcon(icon);
+  setWindowIcon(icon);
+  trayIcon->setToolTip("ChronoChat System Tray Icon");
+  trayIcon->setVisible(true);
+
+  // // QApplication::getMenu ()->addMenu (trayIconMenu);
+  // QMenuBar *bar = new QMenuBar ();
+  // bar->setMenu (trayIconMenu);
+  // setMenuBar (bar);
+}
+
+
+void
 ChatDialog::resizeEvent(QResizeEvent *e)
 {
   fitView();
@@ -816,6 +813,22 @@
 }
 
 void
+ChatDialog::changeEvent(QEvent *e)
+{
+  switch(e->type())
+  {
+  case QEvent::ActivationChange:
+    if (isActiveWindow())
+    {
+      trayIcon->setIcon(QIcon(":/images/icon_small.png"));
+    }
+    break;
+  default:
+    break;
+  }
+}
+
+void
 ChatDialog::appendMessage(const SyncDemo::ChatMessage msg, bool isHistory)
 {
   boost::recursive_mutex::scoped_lock lock(m_msgMutex);
@@ -952,9 +965,8 @@
 {
   if (!isActiveWindow())
   {
-    //TODO: Notification to be done
-    // trayIcon->showMessage(QString("Chatroom %1 has a new message").arg(m_user.getChatroom()), QString("<%1>: %2").arg(from).arg(data), QSystemTrayIcon::Information, 20000);
-    // trayIcon->setIcon(QIcon(":/images/note.png"));
+    trayIcon->showMessage(QString("Chatroom %1 has a new message").arg(m_user.getChatroom()), QString("<%1>: %2").arg(from).arg(data), QSystemTrayIcon::Information, 20000);
+    trayIcon->setIcon(QIcon(":/images/note.png"));
   }
 }
 
