add sync middlewares