background and login/out fixes