correction of aging (use of safe foreach)