fix exception when iterating grouped devices