Channel: save the state upon exit