fix the generateRandomData function