move declaration outside for loop, so that compiler won't complain