Added check for Device Count