listening to swamp process close event