middleware usage