fixed broken indexing