added log in/log out functionality