Fix function random