added log-in mechanism