update middleware to fix issue with class on div (mbox)