diff --git a/index.php b/index.php
index 19b5f73..19a302c 100644
--- a/index.php
+++ b/index.php
@@ -156,7 +156,7 @@
echo '
';
- if (!isset($_SESSION['index']) || isset($_GET['reindex']))
+ if (!isset($_SESSION['index']) || isset($_GET['reindex']) || empty($_SESSION['index']))
{
$files = glob($dir . '/*');
usort($files, function($a, $b)