add login and logout logic