fix array out of index