Added session checking to index.php