Adding function ForEachModuleInDevice