Revert "wrong middleware"

This reverts commit eac21dea5b85d961df71a6f2137bea5be8112de2.