fixed code gen