And loggedout handling

And loggedout handling