pushing ID's to array for use in stopInstances
abstracted out eachIterator function for region and instances