fixed bugged class code generation