diff --git a/templates/files.html b/templates/files.html
index de5918e..e2d56bf 100644
--- a/templates/files.html
+++ b/templates/files.html
@@ -97,8 +97,12 @@
{% endif %}
{% for obj in entry_data %}
{% if loop.index==1 and folders %}
- FIXME: hardcoded 'static/storage'
- {% if cwd != 'static/storage' %}
+ {% if obj.type.name != "Directory" %}
+ {% set root=obj.in_dir.in_path.path_prefix %}
+ {% else %}
+ {% set root=obj.dir_details.in_path.path_prefix %}
+ {% endif %}
+ {% if cwd != root %}