added new test for middleware