Fixed an index error