minor bug in foreach_pipeline