added missing close bracket to foreach loop