Foreach was placed wrong.