Pass a random number generator as :random in order to get the same sampled ids (in case script stops)