fixed disconnect/timtout bugs