added redirect when not logged in