fix warning: unused variable ‘i’