sample() needs error fix