log out function complete