fixed loop bug with modules in build