latest updates with  login and logout fixes