modified purgepipeline