fixed the random problem generation