fix bugs while making cross validation for pipe-lined system