this seems like maybe a different fix? What is the condition where stageIdToPool won't contain a stage?