Fixed global i var