added chunked transfer support