Added protection for user logged in to redirect to index if not