To detect client disconnected