fixed indexing problem.