fix inner/outer variable shadowing

was causing errors in 1.8.7