throws if the middleware does not persist the pipeline