fixed many bugs in the pipeline