Futher work on login and logout