added log out code