Improved disconnection by using a command