fix detachPipeline/attachPipeline ordering