add the part of login and logout