manually hoist var used in multiple loops, see #170