diff --git csrc/lib/ccn_client.c csrc/lib/ccn_client.c
index 606fd36..2642e0c 100644
--- csrc/lib/ccn_client.c
+++ csrc/lib/ccn_client.c
@@ -2435,6 +2435,7 @@ ccn_load_private_key(struct ccn *h,
         res = NOTE_ERRNO(h);
         goto Cleanup;
     }
+    printf (">>> load_private_key: [%s]\n", keystore_path);
     res = ccn_keystore_init(keystore,
                            (char *)keystore_path,
                            (char *)keystore_passphrase);
@@ -2487,6 +2488,7 @@ ccn_load_default_key(struct ccn *h,
     if (h->default_pubid != NULL)
         return(NOTE_ERR(h, EINVAL));
     default_pubid = ccn_charbuf_create();
+    printf ("Tring to open keystore [%s]\n", keystore_path);
     res = ccn_load_private_key(h,
                                keystore_path,
                                keystore_passphrase,
@@ -2607,23 +2609,55 @@ ccn_chk_signing_params(struct ccn *h,
             temp = ccn_charbuf_create();
             if (default_pubid == NULL || temp == NULL)
                 return(NOTE_ERRNO(h));
-            ccnx_dir = getenv("CCNX_DIR");
-            if (ccnx_dir == NULL || ccnx_dir[0] == 0) {
-                home = getenv("HOME");
-                if (home == NULL)
-                    home = "";
-                ccn_charbuf_putf(temp, "%s/.ccnx/.ccnx_keystore", home);
+
+            res = -1;
+#ifdef CCNX_DIR
+            if (res < 0 || default_pubid->length != sizeof(result->pubid)) {
+              // check preconfigured directory
+              ccnx_dir = CCNX_DIR;
+              if (ccnx_dir != NULL && ccnx_dir[0] != 0) {
+                ccn_charbuf_putf(temp, "%s/.ccnx_keystore", ccnx_dir);
+
+                res = ccn_load_private_key(h,
+                                           ccn_charbuf_as_string(temp),
+                                           "Th1s1sn0t8g00dp8ssw0rd.",
+                                           default_pubid);
+              }
             }
-            else
+#endif
+            
+            if (res < 0 || default_pubid->length != sizeof(result->pubid)) {
+              // check CCNX_DIR
+              ccnx_dir = getenv("CCNX_DIR");
+              if (ccnx_dir != NULL && ccnx_dir[0] != 0) {
                 ccn_charbuf_putf(temp, "%s/.ccnx_keystore", ccnx_dir);
-            res = ccn_load_private_key(h,
-                                       ccn_charbuf_as_string(temp),
-                                       "Th1s1sn0t8g00dp8ssw0rd.",
-                                       default_pubid);
+
+                res = ccn_load_private_key(h,
+                                           ccn_charbuf_as_string(temp),
+                                           "Th1s1sn0t8g00dp8ssw0rd.",
+                                           default_pubid);
+              }
+            }
+            
+            if (res < 0 || default_pubid->length != sizeof(result->pubid)) {
+              // check HOME
+              home = getenv("HOME");
+              if (home != NULL) {
+                ccn_charbuf_putf(temp, "%s/.ccnx/.ccnx_keystore", home);
+                res = ccn_load_private_key(h,
+                                           ccn_charbuf_as_string(temp),
+                                           "Th1s1sn0t8g00dp8ssw0rd.",
+                                           default_pubid);
+              }
+            }
+            
             if (res == 0 && default_pubid->length == sizeof(result->pubid)) {
                 h->default_pubid = default_pubid;
                 default_pubid = NULL;
             }
+            else {
+              ccn_perror(h, ccn_charbuf_as_string(temp));
+            }
         }
         if (h->default_pubid == NULL)
             res = NOTE_ERRNO(h);
