add middleware to consumers