Removed bug in DownloadFile

Added a timeout so that the thread actually ends.