login/logout bugfix