Change DD_LIST_FOREACH to DD_LIST_FOREACH_SAFE to protect crash