modify the error of writing  model into cpp