make Random more suitable for multithread.