change process to foreach+fork, see #3