Fix bug with debug in function CheckDownloadState