add foreach to cc mode