Foreach validation
Changed structure