inject middleware