ensure clean exit any time there is exit