use variables in foreach loops