fix code gen