* fixed random function