reworking the login and logout thing