cleanup before going out