Fixed issue with _randomIndex