fix bugs in RI pipeline