fixed generation of code