added support for new middlewares