finish log-in-out