diff --git a/inc/html.php b/inc/html.php
index 3a93a6604e5e9a261b7e20078640f182540e7ca6..ffa1d489f151fd8264481f079392fa4a04628667 100644
--- a/inc/html.php
+++ b/inc/html.php
@@ -876,10 +876,9 @@ function html_index($ns){
     global $conf;
     global $ID;
     $ns  = cleanID($ns);
-    #fixme use appropriate function
     if(empty($ns)){
-        $ns = dirname(str_replace(':','/',$ID));
-        if($ns == '.') $ns ='';
+        $ns = getNS($ID);
+        if($ns == false) $ns ='';
     }
     $ns  = utf8_encodeFN(str_replace(':','/',$ns));