login and logout fix.