added thread safe random methods