fix generation of code