added log in and log out functions for users