add foreach private method