added missing } to for loop