middleware debugging