Adjusted for new Middleware process