Fixed client disconnect detection