Fix bug in external pipeline