improved login / logout