use cxlist safe foreach