diff --git a/src/face-monitor.cpp b/src/face-monitor.cpp
deleted file mode 100644
index 7685471..0000000
--- a/src/face-monitor.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014  University of Memphis,
- *                     Regents of the University of California
- *
- * This file is part of NLSR (Named-data Link State Routing).
- * See AUTHORS.md for complete list of NLSR authors and contributors.
- *
- * NLSR is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NLSR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- *
- * \author A K M Mahmudul Hoque <ahoque1@memphis.edu>
- *
- **/
-#include "face-monitor.hpp"
-#include "logger.hpp"
-
-
-namespace nlsr {
-
-INIT_LOGGER("FaceMonitor");
-
-void
-FaceMonitor::startNotification()
-{
-  ndn::Interest interest("/localhost/nfd/faces/events");
-  interest
-    .setMustBeFresh(true)
-    .setChildSelector(1)
-    .setInterestLifetime(ndn::time::seconds(60));
-
-  _LOG_DEBUG("FaceMonitor::startNotification sending interest: " << interest);
-
-  m_face.expressInterest(interest,
-                         ndn::bind(&nlsr::FaceMonitor::onData, this, _2),
-                         ndn::bind(&nlsr::FaceMonitor::onTimeout, this));
-}
-
-void
-FaceMonitor::onTimeout()
-{
-  ndn::Interest interest("/localhost/nfd/faces/events");
-  interest
-    .setMustBeFresh(true)
-    .setChildSelector(1)
-    .setInterestLifetime(ndn::time::seconds(60));
-
-  _LOG_DEBUG("FaceMonitor::onTimeout sending interest: " << interest);
-
-  m_face.expressInterest(interest,
-                         ndn::bind(&nlsr::FaceMonitor::onData, this, _2),
-                         ndn::bind(&nlsr::FaceMonitor::onTimeout, this));
-}
-void
-FaceMonitor::onData(const ndn::Data& data)
-{
-  m_lastSequence = data.getName().get(-1).toSegment();
-  ndn::nfd::FaceEventNotification notification(data.getContent().blockFromValue());
-  m_notificationCallBack(notification);
-
-  ndn::Name nextNotification("/localhost/nfd/faces/events");
-  nextNotification.appendSegment(m_lastSequence + 1);
-
-  ndn::Interest interest(nextNotification);
-  interest.setInterestLifetime(ndn::time::seconds(60));
-
-  _LOG_DEBUG("FaceMonitor::onData Interest sent: " <<  interest);
-
-  m_face.expressInterest(interest,
-                         ndn::bind(&nlsr::FaceMonitor::onData, this, _2),
-                         ndn::bind(&nlsr::FaceMonitor::onTimeout, this));
-}
-
-
-} // namespace nlsr
diff --git a/src/face-monitor.hpp b/src/face-monitor.hpp
deleted file mode 100644
index 1344f60..0000000
--- a/src/face-monitor.hpp
+++ /dev/null
@@ -1,65 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014  University of Memphis,
- *                     Regents of the University of California
- *
- * This file is part of NLSR (Named-data Link State Routing).
- * See AUTHORS.md for complete list of NLSR authors and contributors.
- *
- * NLSR is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NLSR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- *
- * \author A K M Mahmudul Hoque <ahoque1@memphis.edu>
- *
- **/
-#ifndef FACE_MONITOR_HPP
-#define FACE_MONITOR_HPP
-
-#include <ndn-cxx/face.hpp>
-#include <ndn-cxx/management/nfd-face-event-notification.hpp>
-
-namespace nlsr {
-
-class FaceMonitor
-{
-public:
-  typedef ndn::function<void(const ndn::nfd::FaceEventNotification&)> NotificationCallback;
-  typedef ndn::function<void()> TimeoutCallback;
-
-  FaceMonitor(boost::asio::io_service& ioService, const NotificationCallback& notificationCallBack)
-    : m_face(ioService)
-    , m_notificationCallBack(notificationCallBack)
-  {
-  }
-
-  ~FaceMonitor()
-  {
-  }
-
-  void
-  startNotification();
-
-private:
-  void
-  onTimeout();
-
-  void
-  onData(const ndn::Data& data);
-
-private:
-  ndn::Face m_face;
-  NotificationCallback m_notificationCallBack;
-  uint64_t m_lastSequence;
-};
-
-} // namespace nlsr
-
- #endif //FACE_MONITOR_HPP
diff --git a/src/hello-protocol.cpp b/src/hello-protocol.cpp
index 7bcf3bb..98ab9cd 100644
--- a/src/hello-protocol.cpp
+++ b/src/hello-protocol.cpp
@@ -217,7 +217,8 @@
 HelloProtocol::registerPrefixes(const ndn::Name& adjName, const std::string& faceUri,
                                double linkCost, const ndn::time::milliseconds& timeout)
 {
-  m_nlsr.getFib().registerPrefix(adjName, faceUri, linkCost, timeout, 0,
+  m_nlsr.getFib().registerPrefix(adjName, faceUri, linkCost, timeout,
+                                 ndn::nfd::ROUTE_FLAG_CAPTURE, 0,
                                  ndn::bind(&HelloProtocol::onRegistrationSuccess,
                                            this, _1, adjName,timeout),
                                  ndn::bind(&HelloProtocol::onRegistrationFailure,
@@ -236,11 +237,14 @@
     std::string faceUri = adjacent->getConnectingFaceUri();
     double linkCost = adjacent->getLinkCost();
     m_nlsr.getFib().registerPrefix(m_nlsr.getConfParameter().getChronosyncPrefix(),
-                                 faceUri, linkCost, timeout, 0);
+                                 faceUri, linkCost, timeout,
+                                 ndn::nfd::ROUTE_FLAG_CAPTURE, 0);
     m_nlsr.getFib().registerPrefix(m_nlsr.getConfParameter().getLsaPrefix(),
-                                 faceUri, linkCost, timeout, 0);
+                                 faceUri, linkCost, timeout,
+                                 ndn::nfd::ROUTE_FLAG_CAPTURE, 0);
     m_nlsr.getFib().registerPrefix(broadcastKeyPrefix,
-                                 faceUri, linkCost, timeout, 0);
+                                 faceUri, linkCost, timeout,
+                                 ndn::nfd::ROUTE_FLAG_CAPTURE, 0);
     m_nlsr.setStrategies();
 
     /* interest name: /<neighbor>/NLSR/INFO/<router> */
diff --git a/src/nlsr.cpp b/src/nlsr.cpp
index b9f9cb2..3ee4ccd 100644
--- a/src/nlsr.cpp
+++ b/src/nlsr.cpp
@@ -59,7 +59,9 @@
                                   ndn::bind(&HelloProtocol::processInterest,
                                             &m_helloProtocol, _1, _2),
                                   ndn::bind(&Nlsr::onRegistrationSuccess, this, _1),
-                                  ndn::bind(&Nlsr::registrationFailed, this, _1));
+                                  ndn::bind(&Nlsr::registrationFailed, this, _1),
+                                  m_defaultIdentity,
+                                  ndn::nfd::ROUTE_FLAG_CAPTURE);
 }
 
 void
@@ -73,7 +75,9 @@
                                   ndn::bind(&Lsdb::processInterest,
                                             &m_nlsrLsdb, _1, _2),
                                   ndn::bind(&Nlsr::onRegistrationSuccess, this, _1),
-                                  ndn::bind(&Nlsr::registrationFailed, this, _1));
+                                  ndn::bind(&Nlsr::registrationFailed, this, _1),
+                                  m_defaultIdentity,
+                                  ndn::nfd::ROUTE_FLAG_CAPTURE);
 }
 
 void
@@ -131,6 +135,7 @@
   /* Logging end */
   initializeKey();
   setStrategies();
+  _LOG_DEBUG("Default NLSR identity: " << m_defaultIdentity);
   setInfoInterestFilter();
   setLsaInterestFilter();
   m_nlsrLsdb.buildAndInstallOwnNameLsa();
@@ -138,8 +143,6 @@
   m_syncLogicHandler.createSyncSocket(boost::ref(*this));
   registerKeyPrefix();
   m_helloProtocol.scheduleInterest(10);
-
-  m_faceMonitor.startNotification();
 }
 
 void
@@ -187,7 +190,9 @@
                                ndn::bind(&Nlsr::onKeyInterest,
                                          this, _1, _2),
                                ndn::bind(&Nlsr::onKeyPrefixRegSuccess, this, _1),
-                               ndn::bind(&Nlsr::registrationFailed, this, _1));
+                               ndn::bind(&Nlsr::registrationFailed, this, _1),
+                               m_defaultIdentity,
+                               ndn::nfd::ROUTE_FLAG_CAPTURE);
 
 }
 
@@ -254,11 +259,13 @@
 Nlsr::onFaceEventNotification(const ndn::nfd::FaceEventNotification& faceEventNotification)
 {
   ndn::nfd::FaceEventKind kind = faceEventNotification.getKind();
+  _LOG_DEBUG("Nlsr::onFaceEventNotification called");
   if (kind == ndn::nfd::FACE_EVENT_DESTROYED) {
     uint64_t faceId = faceEventNotification.getFaceId();
     Adjacent *adjacent = m_adjacencyList.findAdjacent(faceId);
     if (adjacent != 0) {
-      _LOG_DEBUG("Face to " << adjacent->getName() << "deleted");
+      _LOG_DEBUG("Face to " << adjacent->getName() << " with face id: "
+                 << faceId << " deleted");
       adjacent->setFaceId(0);
     }
   }
diff --git a/src/nlsr.hpp b/src/nlsr.hpp
index bcfe95b..dd3c99b 100644
--- a/src/nlsr.hpp
+++ b/src/nlsr.hpp
@@ -31,6 +31,7 @@
 #include <ndn-cxx/security/certificate-cache-ttl.hpp>
 #include <ndn-cxx/util/scheduler.hpp>
 #include <ndn-cxx/management/nfd-face-event-notification.hpp>
+#include <ndn-cxx/management/nfd-face-monitor.hpp>
 
 #include "conf-parameter.hpp"
 #include "adjacency-list.hpp"
@@ -42,7 +43,6 @@
 #include "route/fib.hpp"
 #include "communication/sync-logic-handler.hpp"
 #include "hello-protocol.hpp"
-#include "face-monitor.hpp"
 
 #include "validator.hpp"
 
@@ -86,9 +86,11 @@
     , m_certificateCache(new ndn::CertificateCacheTtl(m_nlsrFace.getIoService()))
     , m_validator(m_nlsrFace, DEFAULT_BROADCAST_PREFIX, m_certificateCache)
 
-    , m_faceMonitor(m_nlsrFace.getIoService(),
-                    ndn::bind(&Nlsr::onFaceEventNotification, this, _1))
-  {}
+    , m_faceMonitor(m_nlsrFace)
+  {
+    m_faceMonitor.onNotification += ndn::bind(&Nlsr::onFaceEventNotification, this, _1);
+    m_faceMonitor.start();
+  }
 
   void
   registrationFailed(const ndn::Name& name);
@@ -380,7 +382,7 @@
   ndn::Name m_defaultIdentity;
   ndn::Name m_defaultCertName;
 
-  FaceMonitor m_faceMonitor;
+  ndn::nfd::FaceMonitor m_faceMonitor;
 };
 
 } //namespace nlsr
diff --git a/src/route/fib.cpp b/src/route/fib.cpp
index b99d7a2..7a8e98b 100644
--- a/src/route/fib.cpp
+++ b/src/route/fib.cpp
@@ -82,7 +82,8 @@
       if (isPrefixUpdatable(it->getName())) {
         registerPrefix(it->getName(), nhit->getConnectingFaceUri(),
                        std::ceil(nhit->getRouteCost()),
-                       ndn::time::seconds(m_refreshTime + GRACE_PERIOD), 0);
+                       ndn::time::seconds(m_refreshTime + GRACE_PERIOD),
+                       ndn::nfd::ROUTE_FLAG_CAPTURE, 0);
       }
     }
     // increase sequence number and schedule refresh again
@@ -138,7 +139,8 @@
         if (isPrefixUpdatable(name)) {
           registerPrefix(name, nhit->getConnectingFaceUri(),
                          std::ceil(nhit->getRouteCost()),
-                         ndn::time::seconds(m_refreshTime + GRACE_PERIOD), 0);
+                         ndn::time::seconds(m_refreshTime + GRACE_PERIOD),
+                         ndn::nfd::ROUTE_FLAG_CAPTURE, 0);
         }
       }
       newEntry.getNexthopList().sort();
@@ -162,7 +164,8 @@
         if (isPrefixUpdatable(name)) {
           registerPrefix(name, nhit->getConnectingFaceUri(),
                          std::ceil(nhit->getRouteCost()),
-                         ndn::time::seconds(m_refreshTime + GRACE_PERIOD), 0);
+                         ndn::time::seconds(m_refreshTime + GRACE_PERIOD),
+                         ndn::nfd::ROUTE_FLAG_CAPTURE, 0);
         }
         removeHop(it->getNexthopList(), nhit->getConnectingFaceUri(), name);
         it->getNexthopList().reset();
@@ -175,7 +178,8 @@
           if (isPrefixUpdatable(name)) {
             registerPrefix(name, nhit->getConnectingFaceUri(),
                            std::ceil(nhit->getRouteCost()),
-                           ndn::time::seconds(m_refreshTime + GRACE_PERIOD), 0);
+                           ndn::time::seconds(m_refreshTime + GRACE_PERIOD),
+                           ndn::nfd::ROUTE_FLAG_CAPTURE, 0);
           }
         }
       }
@@ -292,14 +296,22 @@
 void
 Fib::registerPrefix(const ndn::Name& namePrefix, const std::string& faceUri,
                     uint64_t faceCost, const ndn::time::milliseconds& timeout,
-                    uint8_t times)
+                    uint64_t flags, uint8_t times)
 {
   uint64_t faceId = m_nlsr.getAdjacencyList().getFaceId(faceUri);
   if (faceId != 0) {
+    ndn::nfd::ControlParameters faceParameters;
+    faceParameters
+     .setName(namePrefix)
+     .setFaceId(faceId)
+     .setFlags(flags)
+     .setCost(faceCost)
+     .setExpirationPeriod(timeout)
+     .setOrigin(128);
+
     _LOG_DEBUG("Registering prefix: " << namePrefix << " Face Uri: " << faceUri
                << " Face Id: " << faceId);
-    registerPrefixInNfd(namePrefix, faceId,
-                        faceCost, timeout, faceUri, times);
+    registerPrefixInNfd(faceParameters, faceUri, times);
   }
   else {
     _LOG_DEBUG("Error: No Face Id for face uri: " << faceUri);
@@ -311,58 +323,56 @@
                     const std::string& faceUri,
                     uint64_t faceCost,
                     const ndn::time::milliseconds& timeout,
+                    uint64_t flags,
                     uint8_t times,
                     const CommandSucceedCallback& onSuccess,
                     const CommandFailCallback& onFailure)
 
 {
- createFace(faceUri,
-            ndn::bind(&Fib::registerPrefixInNfd, this,_1,
-                      namePrefix, faceCost,
-                      timeout, times, onSuccess, onFailure),
-            onFailure);
-}
-
-void
-Fib::registerPrefixInNfd(const ndn::Name& namePrefix,
-                         uint64_t faceId,
-                         uint64_t faceCost,
-                         const ndn::time::milliseconds& timeout,
-                         const std::string& faceUri,
-                         uint8_t times)
-{
-  ndn::nfd::ControlParameters controlParameters;
-  controlParameters
+  ndn::nfd::ControlParameters parameters;
+  parameters
     .setName(namePrefix)
-    .setFaceId(faceId)
+    .setFlags(flags)
     .setCost(faceCost)
     .setExpirationPeriod(timeout)
     .setOrigin(128);
-  m_controller.start<ndn::nfd::RibRegisterCommand>(controlParameters,
+  createFace(faceUri,
+             ndn::bind(&Fib::registerPrefixInNfd, this,_1,
+                       parameters,
+                       times, onSuccess, onFailure),
+             onFailure);
+}
+
+void
+Fib::registerPrefixInNfd(ndn::nfd::ControlParameters& parameters,
+                         const std::string& faceUri,
+                         uint8_t times)
+{
+  m_controller.start<ndn::nfd::RibRegisterCommand>(parameters,
                                                    ndn::bind(&Fib::onRegistration, this, _1,
                                                              "Successful in name registration",
                                                              faceUri),
                                                    ndn::bind(&Fib::onRegistrationFailure,
                                                              this, _1, _2,
                                                              "Failed in name registration",
-                                                             namePrefix, faceUri, faceCost,
-                                                             timeout, times));
+                                                             parameters,
+                                                             faceUri, times));
 }
 
 void
 Fib::registerPrefixInNfd(const ndn::nfd::ControlParameters& faceCreateResult,
-                         const ndn::Name& namePrefix, uint64_t faceCost,
-                         const ndn::time::milliseconds& timeout,
+                         const ndn::nfd::ControlParameters& parameters,
                          uint8_t times,
                          const CommandSucceedCallback& onSuccess,
                          const CommandFailCallback& onFailure)
 {
   ndn::nfd::ControlParameters controlParameters;
   controlParameters
-    .setName(namePrefix)
+    .setName(parameters.getName())
     .setFaceId(faceCreateResult.getFaceId())
-    .setCost(faceCost)
-    .setExpirationPeriod(timeout)
+    .setCost(parameters.getCost())
+    .setFlags(parameters.getFlags())
+    .setExpirationPeriod(parameters.getExpirationPeriod())
     .setOrigin(128);
   m_controller.start<ndn::nfd::RibRegisterCommand>(controlParameters,
                                                    onSuccess,
@@ -416,7 +426,6 @@
   m_faceMap.writeLog();
 }
 
-
 void
 Fib::onUnregistration(const ndn::nfd::ControlParameters& commandSuccessResult,
                       const std::string& message)
@@ -428,15 +437,18 @@
 void
 Fib::onRegistrationFailure(uint32_t code, const std::string& error,
                            const std::string& message,
-                           const ndn::Name& namePrefix, const std::string& faceUri,
-                           uint64_t faceCost, const ndn::time::milliseconds& timeout,
+                           const ndn::nfd::ControlParameters& parameters,
+                           const std::string& faceUri,
                            uint8_t times)
 {
   _LOG_DEBUG(message << ": " << error << " (code: " << code << ")");
-  _LOG_DEBUG("Prefix: " << namePrefix << " failed for: " << times);
+  _LOG_DEBUG("Prefix: " << parameters.getName() << " failed for: " << times);
   if (times < 3) {
     _LOG_DEBUG("Trying to register again...");
-    registerPrefix(namePrefix, faceUri, faceCost, timeout, times+1);
+    registerPrefix(parameters.getName(), faceUri,
+                   parameters.getCost(),
+                   parameters.getExpirationPeriod(),
+                   parameters.getFlags(), times+1);
   }
   else {
     _LOG_DEBUG("Registration trial given up");
diff --git a/src/route/fib.hpp b/src/route/fib.hpp
index 4c54a79..2522928 100644
--- a/src/route/fib.hpp
+++ b/src/route/fib.hpp
@@ -94,17 +94,19 @@
   void
   registerPrefix(const ndn::Name& namePrefix, const std::string& faceUri,
                  uint64_t faceCost,
-                 const ndn::time::milliseconds& timeout, uint8_t times);
+                 const ndn::time::milliseconds& timeout,
+                 uint64_t flags, uint8_t times);
 
   void
   registerPrefix(const ndn::Name& namePrefix,
                  const std::string& faceUri,
                  uint64_t faceCost,
                  const ndn::time::milliseconds& timeout,
+                 uint64_t flags,
                  uint8_t times,
                  const CommandSucceedCallback& onSuccess,
                  const CommandFailCallback& onFailure);
-  
+
   void
   setStrategy(const ndn::Name& name, const std::string& strategy, uint32_t count);
 
@@ -123,17 +125,13 @@
              const CommandFailCallback& onFailure);
 
   void
-  registerPrefixInNfd(const ndn::Name& namePrefix,
-                      uint64_t faceId,
-                      uint64_t faceCost,
-                      const ndn::time::milliseconds& timeout,
+  registerPrefixInNfd(ndn::nfd::ControlParameters& parameters,
                       const std::string& faceUri,
                       uint8_t times);
 
   void
   registerPrefixInNfd(const ndn::nfd::ControlParameters& faceCreateResult,
-                      const ndn::Name& namePrefix, uint64_t faceCost,
-                      const ndn::time::milliseconds& timeout,
+                      const ndn::nfd::ControlParameters& parameters,
                       uint8_t times,
                       const CommandSucceedCallback& onSuccess,
                       const CommandFailCallback& onFailure);
@@ -157,8 +155,8 @@
   void
   onRegistrationFailure(uint32_t code, const std::string& error,
                         const std::string& message,
-                        const ndn::Name& namePrefix, const std::string& faceUri,
-                        uint64_t faceCost, const ndn::time::milliseconds& timeout,
+                        const ndn::nfd::ControlParameters& parameters,
+                        const std::string& faceUri,
                         uint8_t times);
 
   void
