foreach correction