added middleware to example