add a maximum download size to avoid OOM