Bug in index.php skipping first page