changed how the device count is performed