fix bug on generate data