diff --git a/templates/files.html b/templates/files.html
index 9310439..d1866e9 100644
--- a/templates/files.html
+++ b/templates/files.html
@@ -458,7 +458,7 @@ $(document).ready(function() {
$('#prev').addClass('disabled')
$('#prev').prop('disabled', true)
}
- $(".dir").click( function(e) { $('#cwd').val( $(this).attr('dir') ) ; $('#main_form').submit() } )
+ $(".dir").click( function(e) { $('#offset').val(0) ; $('#cwd').val( $(this).attr('dir') ) ; $('#main_form').submit() } )
} )
{% endblock script_content %}