add foreach like loop