more robustness for file download