update random method