implemented log in and log out