added better randomization seed handling