finish log in and log out