Added test for new middleware