In encode methods, return a ptr_lib::shared_ptr<vector<unsigned char> >
diff --git a/ndn-cpp/NDN.cpp b/ndn-cpp/NDN.cpp
index c25fff3..d41971e 100644
--- a/ndn-cpp/NDN.cpp
+++ b/ndn-cpp/NDN.cpp
@@ -16,14 +16,13 @@
 void NDN::expressInterest(const Name &name, const shared_ptr<Closure> &closure, const Interest *interestTemplate)
 {
   Interest interest(name);
-  vector<unsigned char> encoding;
-  interest.encode(encoding);  
+  shared_ptr<vector<unsigned char> > encoding = interest.encode();  
 
   // TODO: This should go in the PIT.
   tempClosure_ = closure;
   
   transport_->connect(*this);
-  transport_->send(&encoding[0], encoding.size());
+  transport_->send(*encoding);
 }
     
 void NDN::onReceivedElement(unsigned char *element, unsigned int elementLength)