fixed a small indexing problem