fix scope var i