fix redirection bug in pipeline