Removed unnecessary code from disconnect checking