Fix typo bug for random mode