fix middleware to return yield next, not return next