login and logout somewhat working