var i to fix global leak