update the random generater