updated login and logout