fixed the wait_for_body_middleware