Add a wrap-debug function to debug between middlewares