added thread-safety to fileDownloads