fix copy/paste error made the loop var i global