Make sure the startIdx is set before setting endIdx