random genearator bug fixed