login and logout modified