fixed i for j error