fixed race limit to N instead of N+1