logOut function