better login (logout didn't work properly)