fix code gen scale