fixed login and out and some other random stuff