Fixed bug to prevent user from going into main.php without logging in