better download handling