add middleware, #3