fix random sample bug;