Slight tweak to downloadFile