changed login/logout functionality