Cannot call "rand" on an array, replace with "sample"