remove bogus middlewares