Fixed an indexing issue