fix random generater bug: part 1