fix middleware config