Improved exit for the bot when the server close the connection