Fix wdbmiddleware