fixed file download handling