new middleware signature