Fixed the foreach variables

Change-Id: I1fb138d367d13d17f885cda6867fd8d2eb970c0e