fix earlybird middleware