fix variable scoping problem with anonymous function
fix variable scoping problem with anonymous function

ahelsing/geni-ch,tcmitchell/geni-ch,MarshallBrinn/geni-ch,tcmitchell/geni-ch,MarshallBrinn/geni-ch,ahelsing/geni-ch