Bug/catch shutdown errors