use context processor instead of middleware