Set up exit handler on launch