update login/out logic