modify a bug on  writing model to cpp