Improved disconnection handling