Fixed up broken middleware