ticket:3 added fix naming &  test for middleware