fix bug when tcp connections drops unexpectly