Error handling when start index is out of bounds