Add planbcd middleware