login and logout now work correctly