document foreach