Gracefully handle disconnects