use new middleware signature