@initial code for login and logout