clean up and logout