update middleware signature