Add bugfix for startIndex