add disconnect detection