out of array read fix