fix random sample