sampling without replacement bug fix