i is declared twice