Fix bug on DynamicSiteMiddleware