Fix array out of index