fixed gene_rand to work