user log in and log out working correctly