fixup "discard" rng function, unavailable in old versions