Multiple if (claimedDevice && claimedDevice->isValid()) ... changed to if (isDeviceCl...