fix chunked transfer bug