fixed generation bug