Correct defect in determining random selection