bugfix to copyImports()