updated logOut functionality