add back client-side disconnect handling