added the ProfileMiddleware.