update middleware example