fixing pipeline loop