Ensure user cannot go back to main page if not logged in