get the middleware from the class property instead of using the getMiddleware method