diff --git a/tests/test-sync-validator.cc b/tests/test-sync-validator.cc
index 9049edc..6f77f86 100644
--- a/tests/test-sync-validator.cc
+++ b/tests/test-sync-validator.cc
@@ -47,23 +47,23 @@
   Name prefix("/Sync/TestSyncValidator/AddEdge");
   KeyChain keychain;
 
-  Name identity1("/TestSyncValidator/AddEdge-1/" + boost::lexical_cast<std::string>(time::now()));
+  Name identity1("/TestSyncValidator/AddEdge-1/" + boost::lexical_cast<std::string>(ndn::time::toUnixTimestamp(ndn::time::system_clock::now()).count()));
   Name certName1 = keychain.createIdentity(identity1);
   shared_ptr<IdentityCertificate> anchor = keychain.getCertificate(certName1);
 
-  Name identity2("/TestSyncValidator/AddEdge-2/" + boost::lexical_cast<std::string>(time::now()));
+  Name identity2("/TestSyncValidator/AddEdge-2/" + boost::lexical_cast<std::string>(ndn::time::toUnixTimestamp(ndn::time::system_clock::now()).count()));
   Name certName2 = keychain.createIdentity(identity2);
   shared_ptr<IdentityCertificate> introducer = keychain.getCertificate(certName2);
 
-  Name identity3("/TestSyncValidator/AddEdge-3/" + boost::lexical_cast<std::string>(time::now()));
+  Name identity3("/TestSyncValidator/AddEdge-3/" + boost::lexical_cast<std::string>(ndn::time::toUnixTimestamp(ndn::time::system_clock::now()).count()));
   Name certName3 = keychain.createIdentity(identity3);
   shared_ptr<IdentityCertificate> introducee = keychain.getCertificate(certName3);
 
-  Name identity4("/TestSyncValidator/AddEdge-4/" + boost::lexical_cast<std::string>(time::now()));
+  Name identity4("/TestSyncValidator/AddEdge-4/" + boost::lexical_cast<std::string>(ndn::time::toUnixTimestamp(ndn::time::system_clock::now()).count()));
   Name certName4 = keychain.createIdentity(identity4);
   shared_ptr<IdentityCertificate> introducer2 = keychain.getCertificate(certName4);
 
-  Name identity5("/TestSyncValidator/AddEdge-5/" + boost::lexical_cast<std::string>(time::now()));
+  Name identity5("/TestSyncValidator/AddEdge-5/" + boost::lexical_cast<std::string>(ndn::time::toUnixTimestamp(ndn::time::system_clock::now()).count()));
   Name certName5 = keychain.createIdentity(identity5);
   shared_ptr<IdentityCertificate> introducee2 = keychain.getCertificate(certName5);
 
@@ -125,23 +125,28 @@
   Name prefix("/Sync/TestSyncValidator/OfflineValidate");
   KeyChain keychain;
 
-  Name identity1("/TestSyncValidator/OfflineValidate-1/" + boost::lexical_cast<std::string>(time::now()));
+  Name identity1("/TestSyncValidator/OfflineValidate-1/"
+                 + boost::lexical_cast<std::string>(ndn::time::toUnixTimestamp(ndn::time::system_clock::now()).count()));
   Name certName1 = keychain.createIdentity(identity1);
   shared_ptr<IdentityCertificate> anchor = keychain.getCertificate(certName1);
 
-  Name identity2("/TestSyncValidator/OfflineValidate-2/" + boost::lexical_cast<std::string>(time::now()));
+  Name identity2("/TestSyncValidator/OfflineValidate-2/"
+                 + boost::lexical_cast<std::string>(ndn::time::toUnixTimestamp(ndn::time::system_clock::now()).count()));
   Name certName2 = keychain.createIdentity(identity2);
   shared_ptr<IdentityCertificate> introducer = keychain.getCertificate(certName2);
 
-  Name identity3("/TestSyncValidator/OfflineValidate-3/" + boost::lexical_cast<std::string>(time::now()));
+  Name identity3("/TestSyncValidator/OfflineValidate-3/"
+                 + boost::lexical_cast<std::string>(ndn::time::toUnixTimestamp(ndn::time::system_clock::now()).count()));
   Name certName3 = keychain.createIdentity(identity3);
   shared_ptr<IdentityCertificate> introducee = keychain.getCertificate(certName3);
 
-  Name identity4("/TestSyncValidator/OfflineValidate-4/" + boost::lexical_cast<std::string>(time::now()));
+  Name identity4("/TestSyncValidator/OfflineValidate-4/"
+                 + boost::lexical_cast<std::string>(ndn::time::toUnixTimestamp(ndn::time::system_clock::now()).count()));
   Name certName4 = keychain.createIdentity(identity4);
   shared_ptr<IdentityCertificate> introducer2 = keychain.getCertificate(certName4);
 
-  Name identity5("/TestSyncValidator/OfflineValidate-5/" + boost::lexical_cast<std::string>(time::now()));
+  Name identity5("/TestSyncValidator/OfflineValidate-5/"
+                 + boost::lexical_cast<std::string>(ndn::time::toUnixTimestamp(ndn::time::system_clock::now()).count()));
   Name certName5 = keychain.createIdentity(identity5);
   shared_ptr<IdentityCertificate> introducee2 = keychain.getCertificate(certName5);
 
@@ -191,7 +196,7 @@
 		     bind(&onValidated2, _1),
 		     bind(&onValidationFailed2, _1, _2));
 
-  ioService->run();
+  // ioService->run();
 
   keychain.deleteIdentity(identity1);
   keychain.deleteIdentity(identity2);
@@ -200,7 +205,55 @@
   keychain.deleteIdentity(identity5);
 }
 
-BOOST_AUTO_TEST_CASE (OnlineValidate)
+struct FacesFixture
+{
+  FacesFixture()
+    : regPrefixId(0)
+    , regPrefixId2(0)
+  {}
+  
+  void
+  onInterest(ndn::shared_ptr<ndn::Face> face, ndn::shared_ptr<ndn::Data> data)
+  {
+    face->put(*data);
+    face->unsetInterestFilter(regPrefixId);
+  }
+
+  void
+  onInterest2(ndn::shared_ptr<ndn::Face> face, ndn::shared_ptr<ndn::Data> data)
+  {
+    face->put(*data);
+    face->unsetInterestFilter(regPrefixId2);
+  }
+
+  void
+  onRegFailed()
+  {}
+
+  void
+  validate(ndn::shared_ptr<Sync::SyncValidator> validator, ndn::shared_ptr<ndn::Data> data, 
+           const ndn::Name& certName3, const ndn::Name& certName4)
+  {
+    validator->validate(*data,
+                        bind(&onValidated, _1),
+                        bind(&onValidationFailed, _1, _2));
+
+
+    BOOST_CHECK(validator->canTrust(certName3));
+    BOOST_CHECK(validator->canTrust(certName4));
+  }
+
+  void
+  terminate(ndn::shared_ptr<ndn::Face> face)
+  {
+    face->ioService()->stop();
+  }
+
+  const ndn::RegisteredPrefixId* regPrefixId;
+  const ndn::RegisteredPrefixId* regPrefixId2;
+};
+
+BOOST_FIXTURE_TEST_CASE(OnlineValidate, FacesFixture)
 {
   using namespace Sync;
   using namespace ndn;
@@ -208,55 +261,66 @@
   Name prefix("/Sync/TestSyncValidator/OnlineValidate");
   KeyChain keychain;
 
-  Name identity1("/TestSyncValidator/OnlineValidate-1/" + boost::lexical_cast<std::string>(time::now()));
+  Name identity1("/TestSyncValidator/OnlineValidate-1/" 
+                 + boost::lexical_cast<std::string>(ndn::time::toUnixTimestamp(ndn::time::system_clock::now()).count()));
   Name certName1 = keychain.createIdentity(identity1);
   shared_ptr<IdentityCertificate> anchor = keychain.getCertificate(certName1);
 
-  Name identity2("/TestSyncValidator/OnlineValidate-2/" + boost::lexical_cast<std::string>(time::now()));
+  Name identity2("/TestSyncValidator/OnlineValidate-2/" 
+                 + boost::lexical_cast<std::string>(ndn::time::toUnixTimestamp(ndn::time::system_clock::now()).count()));
   Name certName2 = keychain.createIdentity(identity2);
   shared_ptr<IdentityCertificate> introducer = keychain.getCertificate(certName2);
 
-  Name identity3("/TestSyncValidator/OnlineValidate-3/" + boost::lexical_cast<std::string>(time::now()));
+  Name identity3("/TestSyncValidator/OnlineValidate-3/" 
+                 + boost::lexical_cast<std::string>(ndn::time::toUnixTimestamp(ndn::time::system_clock::now()).count()));
   Name certName3 = keychain.createIdentity(identity3);
   shared_ptr<IdentityCertificate> introducee = keychain.getCertificate(certName3);
 
-  Name identity4("/TestSyncValidator/OfflineValidate-4/" + boost::lexical_cast<std::string>(time::now()));
+  Name identity4("/TestSyncValidator/OnlineValidate-4/"
+                 + boost::lexical_cast<std::string>(ndn::time::toUnixTimestamp(ndn::time::system_clock::now()).count()));
   Name certName4 = keychain.createIdentity(identity4);
   shared_ptr<IdentityCertificate> introducee2 = keychain.getCertificate(certName4);
 
   shared_ptr<boost::asio::io_service> ioService = make_shared<boost::asio::io_service>();
   shared_ptr<Face> face = make_shared<Face>(ioService);
+  shared_ptr<Face> face2 = make_shared<Face>(ioService);
+
   shared_ptr<SecRuleRelative> rule;
-  SyncValidator validator(prefix, *anchor, face,
-                          bind(&publishData, _1, _2, _3),
-                          rule);
+  shared_ptr<SyncValidator> validator = shared_ptr<SyncValidator>
+    (new SyncValidator(prefix, *anchor, face2, bind(&publishData, _1, _2, _3), rule));
 
-  validator.addParticipant(*introducer);
-  BOOST_CHECK(validator.canTrust(certName2));
+  validator->addParticipant(*introducer);
+  BOOST_CHECK(validator->canTrust(certName2));
   
-  IntroCertificate introCert(prefix, *introducee, certName2.getPrefix(-1));
-  keychain.sign(introCert, certName2);
-  face->put(introCert);
-  BOOST_CHECK(validator.canTrust(certName3) == false);
+  shared_ptr<IntroCertificate> introCert = shared_ptr<IntroCertificate>(new IntroCertificate(prefix, *introducee, certName2.getPrefix(-1)));
+  keychain.sign(*introCert, certName2);
+  BOOST_CHECK(validator->canTrust(certName3) == false);
 
-  IntroCertificate introCert2(prefix, *introducee2, certName3.getPrefix(-1));
-  keychain.sign(introCert2, certName3);
-  face->put(introCert2);
-  BOOST_CHECK(validator.canTrust(certName4) == false);
+  shared_ptr<IntroCertificate> introCert2 = shared_ptr<IntroCertificate>(new IntroCertificate(prefix, *introducee2, certName3.getPrefix(-1)));
+  keychain.sign(*introCert2, certName3);
+  BOOST_CHECK(validator->canTrust(certName4) == false);
 
   Name dataName1 = prefix;
   dataName1.append("data-1");
   shared_ptr<Data> data1 = make_shared<Data>(dataName1);
   keychain.sign(*data1, certName4);
 
-  validator.validate(*data1,
-		     bind(&onValidated, _1),
-		     bind(&onValidationFailed, _1, _2));
+  ndn::Scheduler scheduler(*ioService);
 
-  ioService->run();
+  scheduler.scheduleEvent(time::seconds(1),
+                          bind(&FacesFixture::terminate, this, face));
 
-  BOOST_CHECK(validator.canTrust(certName3));
-  BOOST_CHECK(validator.canTrust(certName4));
+  regPrefixId = face->setInterestFilter(introCert->getName().getPrefix(-1),
+                                       bind(&FacesFixture::onInterest, this, face, introCert),
+                                       bind(&FacesFixture::onRegFailed, this));
+  
+  regPrefixId2 = face->setInterestFilter(introCert2->getName().getPrefix(-1),
+					bind(&FacesFixture::onInterest2, this, face, introCert2),
+					bind(&FacesFixture::onRegFailed, this));
+
+  scheduler.scheduleEvent(time::milliseconds(200),
+                          bind(&FacesFixture::validate, this,
+			       validator, data1, certName3, certName4));
 
   keychain.deleteIdentity(identity1);
   keychain.deleteIdentity(identity2);
