Copy list of modules since it may change during iteration