Randomization bug fixed