fix bug in rng (not shared!)