Added automated iteration for scanIds.