fix generation bug