fixed order of middleware