fix bug for cannot download file into destination directory