diff --git a/ccnx/ccnx-selectors.h b/ccnx/ccnx-selectors.h
index 1275217..420f33e 100644
--- a/ccnx/ccnx-selectors.h
+++ b/ccnx/ccnx-selectors.h
@@ -62,7 +62,7 @@
   answerOriginKind(AOK kind) {m_answerOriginKind = kind; return *this;}
 
   inline Selectors &
-  interestLifetime(int lifetime) {m_interestLifetime = lifetime; return *this;}
+  interestLifetime(double lifetime) {m_interestLifetime = lifetime; return *this;}
 
   inline Selectors &
   scope(int scope) {m_scope = scope; return *this;}
diff --git a/src/fetcher.cc b/src/fetcher.cc
index 876cab4..01a82a4 100644
--- a/src/fetcher.cc
+++ b/src/fetcher.cc
@@ -67,6 +67,7 @@
 {
   m_active = true;
   m_minSendSeqNo = m_maxInOrderRecvSeqNo;
+  // cout << "Restart: " << m_minSendSeqNo << endl;
   m_lastPositiveActivity = date_time::second_clock<boost::posix_time::ptime>::universal_time();
 
   FillPipeline ();
@@ -83,9 +84,14 @@
 {
   for (; m_minSendSeqNo < m_maxSeqNo && m_activePipeline < m_pipeline; m_minSendSeqNo++)
     {
+      if (m_outOfOrderRecvSeqNo.find (m_minSendSeqNo+1) != m_outOfOrderRecvSeqNo.end ())
+        continue;
+
+      // cout << ">>> " << m_minSendSeqNo+1 << endl;
       m_ccnx->sendInterest (Name (m_name)(m_minSendSeqNo+1),
                             Closure (bind(&Fetcher::OnData, this, m_minSendSeqNo+1, _1, _2),
-                                     bind(&Fetcher::OnTimeout, this, m_minSendSeqNo+1, _1)));
+                                     bind(&Fetcher::OnTimeout, this, m_minSendSeqNo+1, _1)),
+                            Selectors().interestLifetime (1)); // Alex: this lifetime should be changed to RTO
 
       m_activePipeline ++;
     }
@@ -140,6 +146,7 @@
       m_activePipeline --;
       if (m_activePipeline == 0)
         {
+          m_active = false;
           m_onFetchFailed (*this);
           // this is not valid anymore, but we still should be able finish work
         }
diff --git a/test/test-fetch-manager.cc b/test/test-fetch-manager.cc
index d28570e..55c85df 100644
--- a/test/test-fetch-manager.cc
+++ b/test/test-fetch-manager.cc
@@ -61,7 +61,7 @@
         recvContent.insert (*reinterpret_cast<const int*> (head(data)));
       }
 
-    // cout << basename << ", " << name << ", " << seqno << endl;
+    // cout << "<<< " << basename << ", " << name << ", " << seqno << endl;
   }
 
   void
@@ -89,14 +89,16 @@
   // this will allow us to test our pipeline of 6
   for (int i = 0; i < 10; i++)
     {
-      ccnx->publishData (Name (baseName)(i), reinterpret_cast<const unsigned char*> (&i), sizeof(int), 10);
+      ccnx->publishData (Name (baseName)(i), reinterpret_cast<const unsigned char*> (&i), sizeof(int), 30);
+    }
 
-      int other = 10 + i+5;
-      ccnx->publishData (Name (baseName)(other), reinterpret_cast<const unsigned char*> (&other), sizeof(int), 10);
+  for (int i = 15; i < 25; i++)
+    {
+      ccnx->publishData (Name (baseName)(i), reinterpret_cast<const unsigned char*> (&i), sizeof(int), 30);
     }
 
   int oneMore = 26;
-  ccnx->publishData (Name (baseName)(oneMore), reinterpret_cast<const unsigned char*> (&oneMore), sizeof(int), 10);
+  ccnx->publishData (Name (baseName)(oneMore), reinterpret_cast<const unsigned char*> (&oneMore), sizeof(int), 30);
 
   FetcherTestData data;
 
@@ -111,22 +113,57 @@
   fetcher.RestartPipeline ();
   BOOST_CHECK_EQUAL (fetcher.IsActive (), true);
 
-  usleep(13000000);
+  usleep(7000000);
   BOOST_CHECK_EQUAL (data.m_failed, true);
   BOOST_CHECK_EQUAL (data.differentNames.size (), 1);
-  BOOST_CHECK_EQUAL (data.segmentNames.size (), 10);
-  BOOST_CHECK_EQUAL (data.recvData.size (), 10);
-  BOOST_CHECK_EQUAL (data.recvContent.size (), 10);
+  BOOST_CHECK_EQUAL (data.segmentNames.size (), 20);
+  BOOST_CHECK_EQUAL (data.recvData.size (), 20);
+  BOOST_CHECK_EQUAL (data.recvContent.size (), 20);
 
-  ostringstream recvData;
-  for (set<uint32_t>::iterator i = data.recvData.begin (); i != data.recvData.end (); i++)
-    recvData << *i << ", ";
+  {
+    ostringstream recvData;
+    for (set<uint32_t>::iterator i = data.recvData.begin (); i != data.recvData.end (); i++)
+      recvData << *i << ", ";
 
-  ostringstream recvContent;
-  for (set<uint32_t>::iterator i = data.recvContent.begin (); i != data.recvContent.end (); i++)
-    recvContent << *i << ", ";
+    ostringstream recvContent;
+    for (set<uint32_t>::iterator i = data.recvContent.begin (); i != data.recvContent.end (); i++)
+      recvContent << *i << ", ";
 
-  BOOST_CHECK_EQUAL (recvData.str (), recvContent.str ());
+    BOOST_CHECK_EQUAL (recvData.str (), "0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, ");
+    BOOST_CHECK_EQUAL (recvData.str (), recvContent.str ());
+  }
+
+  BOOST_CHECK_EQUAL (fetcher.IsActive (), false);
+  fetcher.RestartPipeline ();
+  BOOST_CHECK_EQUAL (fetcher.IsActive (), true);
+
+  usleep(7000000);
+  BOOST_CHECK_EQUAL (data.m_failed, true);
+
+  // publishing missing pieces
+  for (int i = 0; i < 27; i++)
+    {
+      ccnx->publishData (Name (baseName)(i), reinterpret_cast<const unsigned char*> (&i), sizeof(int), 1);
+    }
+  BOOST_CHECK_EQUAL (fetcher.IsActive (), false);
+  fetcher.RestartPipeline ();
+  BOOST_CHECK_EQUAL (fetcher.IsActive (), true);
+
+  usleep(1000000);
+  BOOST_CHECK_EQUAL (data.m_done, true);
+
+  {
+    ostringstream recvData;
+    for (set<uint32_t>::iterator i = data.recvData.begin (); i != data.recvData.end (); i++)
+      recvData << *i << ", ";
+
+    ostringstream recvContent;
+    for (set<uint32_t>::iterator i = data.recvContent.begin (); i != data.recvContent.end (); i++)
+      recvContent << *i << ", ";
+
+    BOOST_CHECK_EQUAL (recvData.str (), "0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, ");
+    BOOST_CHECK_EQUAL (recvData.str (), recvContent.str ());
+  }
 }
 
 // BOOST_AUTO_TEST_CASE (CcnxWrapperSelector)
