added random generator callback