Add clean up to the input and output session