diff --git a/nlsr-sync-0.0/macbook.conf b/nlsr-sync-0.0/macbook.conf
index 3cebed4..4150a56 100755
--- a/nlsr-sync-0.0/macbook.conf
+++ b/nlsr-sync-0.0/macbook.conf
@@ -15,7 +15,7 @@
 multi-path-face-num 2 
 debug on
 
-topo-prefix /ndn/routing/nlsr
-slice-prefix /ndn/routing/nlsr/LSA
+topo-prefix /ndn/test/topo
+slice-prefix /ndn/test/slice
 
 logdir /Users/akmhoque/NLSR2.0
diff --git a/nlsr-sync-0.0/nlsr_sync.c b/nlsr-sync-0.0/nlsr_sync.c
index d2ba580..6029c4d 100644
--- a/nlsr-sync-0.0/nlsr_sync.c
+++ b/nlsr-sync-0.0/nlsr_sync.c
@@ -203,49 +203,48 @@
 }
 
 
-char *
-get_content_by_content_name(char *content_name)
+//char *
+void 
+get_content_by_content_name(char *content_name, unsigned char *content_data)
 {
 
-    struct ccn_charbuf *name = NULL;
-    struct ccn_charbuf *templ = NULL;
-    struct ccn_charbuf *resultbuf = NULL;
-    struct ccn_parsed_ContentObject pcobuf = { 0 };
-    int res;
-    int allow_stale = 0;
-    int content_only = 1;
-    int scope = -1;
-    const unsigned char *ptr;
-    size_t length;
-    int resolve_version = CCN_V_HIGHEST;
-    int timeout_ms = 3000;
-    const unsigned lifetime_default = CCN_INTEREST_LIFETIME_SEC << 12;
-    unsigned lifetime_l12 = lifetime_default;
-    int get_flags = 0;
-    
+	struct ccn_charbuf *name = NULL;
+	struct ccn_charbuf *templ = NULL;
+	struct ccn_charbuf *resultbuf = NULL;
+	struct ccn_parsed_ContentObject pcobuf = { 0 };
+	int res;
+	int allow_stale = 0;
+	int content_only = 1;
+	int scope = -1;
+	const unsigned char *ptr; 
+	size_t length;
+	int resolve_version = CCN_V_HIGHEST;
+	int timeout_ms = 3000;
+	const unsigned lifetime_default = CCN_INTEREST_LIFETIME_SEC << 12;
+	unsigned lifetime_l12 = lifetime_default;
+	int get_flags = 0;
 
-    name = ccn_charbuf_create();
-    res = ccn_name_from_uri(name,content_name);
-    if (res < 0) {
-        fprintf(stderr, "Bad ccn URI: %s\n", content_name);
-        exit(1);
-    }
-  
-   
+	name = ccn_charbuf_create();
+	res = ccn_name_from_uri(name,content_name);
+	if (res < 0) {
+		fprintf(stderr, "Bad ccn URI: %s\n", content_name);
+		exit(1);
+	}
+
 	if (allow_stale || lifetime_l12 != lifetime_default || scope != -1) {
-        templ = ccn_charbuf_create();
-        ccn_charbuf_append_tt(templ, CCN_DTAG_Interest, CCN_DTAG);
-        ccn_charbuf_append_tt(templ, CCN_DTAG_Name, CCN_DTAG);
-        ccn_charbuf_append_closer(templ); /* </Name> */
+		templ = ccn_charbuf_create();
+		ccn_charbuf_append_tt(templ, CCN_DTAG_Interest, CCN_DTAG);
+		ccn_charbuf_append_tt(templ, CCN_DTAG_Name, CCN_DTAG);
+		ccn_charbuf_append_closer(templ); /* </Name> */
 		if (allow_stale) {
 			ccn_charbuf_append_tt(templ, CCN_DTAG_AnswerOriginKind, CCN_DTAG);
 			ccnb_append_number(templ,
-							   CCN_AOK_DEFAULT | CCN_AOK_STALE);
+					CCN_AOK_DEFAULT | CCN_AOK_STALE);
 			ccn_charbuf_append_closer(templ); /* </AnswerOriginKind> */
 		}
-        if (scope != -1) {
-            ccnb_tagged_putf(templ, CCN_DTAG_Scope, "%d", scope);
-        }
+		if (scope != -1) {
+			ccnb_tagged_putf(templ, CCN_DTAG_Scope, "%d", scope);
+		}
 		if (lifetime_l12 != lifetime_default) {
 			/*
 			 * Choose the interest lifetime so there are at least 3
@@ -257,32 +256,35 @@
 				buf[i] = lifetime_l12 & 0xff;
 			ccnb_append_tagged_blob(templ, CCN_DTAG_InterestLifetime, buf, sizeof(buf));
 		}
-        ccn_charbuf_append_closer(templ); /* </Interest> */
-    }
-    resultbuf = ccn_charbuf_create();
-    if (resolve_version != 0) {
-        res = ccn_resolve_version(nlsr->ccn, name, resolve_version, 500);
-        if (res >= 0) {
-            ccn_uri_append(resultbuf, name->buf, name->length, 1);
-            //fprintf(stderr, "== %s\n",ccn_charbuf_as_string(resultbuf));
-            resultbuf->length = 0;
-        }
-    }
-    res = ccn_get(nlsr->ccn, name, templ, timeout_ms, resultbuf, &pcobuf, NULL, get_flags);
-    if (res >= 0) {
-        ptr = resultbuf->buf;
-        length = resultbuf->length;
-        if (content_only)
-            ccn_content_get_value(ptr, length, &pcobuf, &ptr, &length);
-    }
-    ccn_charbuf_destroy(&resultbuf);
-    ccn_charbuf_destroy(&templ);
-    ccn_charbuf_destroy(&name);   
-	return (char *)ptr;
+		ccn_charbuf_append_closer(templ); /* </Interest> */
+	}
+	resultbuf = ccn_charbuf_create();
+	if (resolve_version != 0) {
+		res = ccn_resolve_version(nlsr->ccn, name, resolve_version, 500);
+		if (res >= 0) {
+			ccn_uri_append(resultbuf, name->buf, name->length, 1);
+			//fprintf(stderr, "== %s\n",ccn_charbuf_as_string(resultbuf));
+			resultbuf->length = 0;
+		}
+	}
+	res = ccn_get(nlsr->ccn, name, templ, timeout_ms, resultbuf, &pcobuf, NULL, get_flags);
+	if (res >= 0) {
+		ptr = resultbuf->buf;
+		length = resultbuf->length;
+		if (content_only){
+			ccn_content_get_value(ptr, length, &pcobuf, &ptr, &length);
+			content_data = (unsigned char *) calloc(length, sizeof(char *));
+			memcpy (content_data, ptr, length);
+		}
+	}
+	ccn_charbuf_destroy(&resultbuf);
+	ccn_charbuf_destroy(&templ);
+	ccn_charbuf_destroy(&name);   
+	//return (unsigned char *)ptr;
 }
 
 void 
-process_incoming_sync_content_lsa(char *content_data)
+process_incoming_sync_content_lsa( unsigned char *content_data)
 {
 
 
@@ -316,7 +318,7 @@
 	//if ( nlsr->detailed_logging )
 	//	writeLogg(__FILE__,__FUNCTION__,__LINE__,"LSA Data\n");	
 
-	if( strlen(content_data ) > 0 )
+	if( strlen((char *)content_data ) > 0 )
 	{
 
 		orig_router=strtok_r((char *)content_data,sep,&rem);
@@ -389,6 +391,8 @@
 	int ls_type;
 	long int ls_id=0;
 
+	unsigned char *content_data = NULL;
+
 	char *time_stamp=(char *)malloc(20);
 	memset(time_stamp,0,20);
 	get_current_timestamp_micro(time_stamp);
@@ -422,14 +426,16 @@
 			if ( is_new_name_lsa == 1 )
 			{
 				printf("New NAME LSA.....\n");	
-				char *content_data=get_content_by_content_name(ccn_charbuf_as_string(uri));
+				//content_data=get_content_by_content_name(ccn_charbuf_as_string(uri));
+				get_content_by_content_name(ccn_charbuf_as_string(uri), content_data);
 				printf("Content Data: %s \n",content_data);
 				process_incoming_sync_content_lsa(content_data);
 			}
 			else 
 			{
 				printf("Name LSA / Newer Name LSA already xists in LSDB\n");
-				char *content_data=get_content_by_content_name(ccn_charbuf_as_string(uri));
+				//content_data=get_content_by_content_name(ccn_charbuf_as_string(uri));
+				get_content_by_content_name(ccn_charbuf_as_string(uri),content_data);
 				printf("Content Data: %s \n",content_data);
 			}
 		}
@@ -454,7 +460,8 @@
 			if ( is_new_adj_lsa == 1 )
 			{
 				printf("New Adj LSA.....\n");	
-				char *content_data=get_content_by_content_name(ccn_charbuf_as_string(uri));
+				//content_data=get_content_by_content_name(ccn_charbuf_as_string(uri));
+				get_content_by_content_name(ccn_charbuf_as_string(uri), content_data);
 				printf("Content Data: %s \n",content_data);
 				process_incoming_sync_content_lsa(content_data);			
 			}
@@ -462,7 +469,7 @@
 			{
 
 				printf("Adj LSA / Newer Adj LSA already exists in LSDB\n");
-				char *content_data=get_content_by_content_name(ccn_charbuf_as_string(uri));
+				get_content_by_content_name(ccn_charbuf_as_string(uri), content_data);
 				printf("Content Data: %s \n",content_data);
 			}
 		}
@@ -472,8 +479,8 @@
 		}
 	}
 
+	free(content_data);
 	ccn_charbuf_destroy(&uri);
-
 }
 
 int
