added log-in log-out function