Middleware Fix