finish login & logout