added log out function