Revert "turn off middleware"

This reverts commit 93a4a6c59a71e24f9f2b393bcdcef6c9fe056aeb.