adding client side disconnect detection