fixed array index problem.