login and logout fixed