diff --git a/src/hello-protocol.cpp b/src/hello-protocol.cpp
index ad6709c..4fe528c 100644
--- a/src/hello-protocol.cpp
+++ b/src/hello-protocol.cpp
@@ -164,6 +164,12 @@
 void
 HelloProtocol::onContent(const ndn::Interest& interest, const ndn::Data& data)
 {
+  _LOG_DEBUG("Received data for INFO(name): " << data.getName());
+  if (data.getSignature().hasKeyLocator()) {
+    if (data.getSignature().getKeyLocator().getType() == ndn::KeyLocator::KeyLocator_Name) {
+      _LOG_DEBUG("Data signed with: " << data.getSignature().getKeyLocator().getName());
+    }
+  }
   m_nlsr.getValidator().validate(data,
                                  ndn::bind(&HelloProtocol::onContentValidated, this, _1),
                                  ndn::bind(&HelloProtocol::onContentValidationFailed,
@@ -175,7 +181,7 @@
 {
   /* data name: /<neighbor>/NLSR/INFO/<router>/<version> */
   ndn::Name dataName = data->getName();
-  _LOG_DEBUG("Data received for name: " << dataName);
+  _LOG_DEBUG("Data validation successful for INFO(name): " << dataName);
   if (dataName.get(-3).toUri() == INFO_COMPONENT) {
     ndn::Name neighbor = dataName.getPrefix(-4);
     int oldStatus = m_nlsr.getAdjacencyList().getStatusOfNeighbor(neighbor);
@@ -217,7 +223,7 @@
                                  ndn::bind(&HelloProtocol::onRegistrationSuccess,
                                            this, _1, adjName),
                                  ndn::bind(&HelloProtocol::onRegistrationFailure,
-                                           this, _1, _2));
+                                           this, _1, _2, adjName));
   m_nlsr.getFib().registerPrefix(m_nlsr.getConfParameter().getChronosyncPrefix(),
                                  faceUri, linkCost, timeout);
   m_nlsr.getFib().registerPrefix(m_nlsr.getConfParameter().getLsaPrefix(),
@@ -245,9 +251,38 @@
 }
 
 void
-HelloProtocol::onRegistrationFailure(uint32_t code, const std::string& error)
+HelloProtocol::onRegistrationFailure(uint32_t code, const std::string& error,
+                                     const ndn::Name& name)
 {
   _LOG_DEBUG(error << " (code: " << code << ")");
+  /*
+  * If NLSR can not create face for given faceUri then it will treat this
+  * failure as one INFO interest timed out. So that NLSR can move on with
+  * building Adj Lsa and calculate routing table. NLSR does not build Adj
+  * Lsa unless all the neighbors are ACTIVE or DEAD. For considering the
+  * missconfigured(link) neighbour dead this is required.
+  */
+  Adjacent *adjacent = m_nlsr.getAdjacencyList().findAdjacent(name);
+  if (adjacent != 0) {
+    adjacent->setInterestTimedOutNo(adjacent->getInterestTimedOutNo() + 1);
+    int status = adjacent->getStatus();
+    uint32_t infoIntTimedOutCount = adjacent->getInterestTimedOutNo();
+
+    if (infoIntTimedOutCount == m_nlsr.getConfParameter().getInterestRetryNumber()) {
+      if ( status == 1) {
+        adjacent->setStatus(0);
+      }
+      m_nlsr.incrementAdjBuildCount();
+      if (m_nlsr.getIsBuildAdjLsaSheduled() == false) {
+        _LOG_DEBUG("Scheduling scheduledAdjLsaBuild");
+        m_nlsr.setIsBuildAdjLsaSheduled(true);
+        // event here
+        m_nlsr.getScheduler().scheduleEvent(ndn::time::seconds(5),
+                                            ndn::bind(&Lsdb::scheduledAdjLsaBuild,
+                                                      &m_nlsr.getLsdb()));
+      }
+    }
+  }
 }
 
 } //namespace nlsr
diff --git a/src/hello-protocol.hpp b/src/hello-protocol.hpp
index 063e6a8..b1ccd56 100644
--- a/src/hello-protocol.hpp
+++ b/src/hello-protocol.hpp
@@ -68,7 +68,8 @@
                             const std::string& msg);
 
   void
-  onRegistrationFailure(uint32_t code, const std::string& error);
+  onRegistrationFailure(uint32_t code, const std::string& error,
+                        const ndn::Name& name);
 
   void
   onRegistrationSuccess(const ndn::nfd::ControlParameters& commandSuccessResult,
diff --git a/src/lsdb.cpp b/src/lsdb.cpp
index 5076f5e..c5aea44 100644
--- a/src/lsdb.cpp
+++ b/src/lsdb.cpp
@@ -752,8 +752,10 @@
 Lsdb::expressInterest(const ndn::Name& interestName, uint32_t interestLifeTime,
                       uint32_t timeoutCount)
 {
-  _LOG_DEBUG("Expressing Interest for LSA(name): " << interestName);
   ndn::Interest interest(interestName);
+  uint64_t interestedLsSeqNo = interestName[-1].toNumber();
+  _LOG_DEBUG("Expressing Interest for LSA(name): " << interestName <<
+              " Seq number: " << interestedLsSeqNo );
   interest.setInterestLifetime(ndn::time::seconds(interestLifeTime));
   interest.setMustBeFresh(true);
   m_nlsr.getNlsrFace().expressInterest(interest,
@@ -779,6 +781,7 @@
                                          interest.getName().size() - lsaPosition - 3));
     interestedLsType  = intName[-2].toUri();
     interestedLsSeqNo = intName[-1].toNumber();
+    _LOG_DEBUG("LSA sequence number from interest: " << interestedLsSeqNo);
     if (interestedLsType == "name") {
       processInterestForNameLsa(interest,
                                 origRouter.append(interestedLsType),
@@ -811,7 +814,10 @@
   data->setFreshnessPeriod(ndn::time::seconds(10));
   data->setContent(reinterpret_cast<const uint8_t*>(content.c_str()), content.size());
   m_nlsr.getKeyChain().sign(*data, m_nlsr.getDefaultCertName());
+  ndn::SignatureSha256WithRsa signature(data->getSignature());
+  ndn::Name signingCertName = signature.getKeyLocator().getName();
   _LOG_DEBUG("Sending data for LSA(name): " << interest.getName());
+  _LOG_DEBUG("Data signed with: " << signingCertName);
   m_nlsr.getNlsrFace().put(*data);
 }
 
@@ -860,6 +866,12 @@
 void
 Lsdb::onContent(const ndn::Interest& interest, const ndn::Data& data)
 {
+  _LOG_DEBUG("Received data for LSA(name): " << data.getName());
+  if (data.getSignature().hasKeyLocator()) {
+    if (data.getSignature().getKeyLocator().getType() == ndn::KeyLocator::KeyLocator_Name) {
+      _LOG_DEBUG("Data signed with: " << data.getSignature().getKeyLocator().getName());
+    }
+  }
   m_nlsr.getValidator().validate(data,
                                  ndn::bind(&Lsdb::onContentValidated, this, _1),
                                  ndn::bind(&Lsdb::onContentValidationFailed, this, _1, _2));
@@ -870,7 +882,7 @@
 Lsdb::onContentValidated(const ndn::shared_ptr<const ndn::Data>& data)
 {
   const ndn::Name& dataName = data->getName();
-  _LOG_DEBUG("Data received for LSA(name): " << dataName);
+  _LOG_DEBUG("Data validation successful for LSA(name): " << dataName);
   string dataContent(reinterpret_cast<const char*>(data->getContent().value()));
   string chkString("LSA");
   int32_t lsaPosition = util::getNameComponentPosition(dataName, chkString);
