remove duplicate i variable