Check if index > length of array