added random method in model