fixed code generation to generate to multiple files with correct content