fixed a bug in data generator