pass config to user defined middlewares