Improve disconnection detection