adding redirect to index when user not logged in