middleware, close #3