Update pipeline.py

bugfix per Oriol's email