make rebuildstaging rebuild work again

was an issue with trying to loop through an iterator twice