fix for loops that close over lexicals