fix warning on attempt to replace middleware