Improve detection of bad download ,restabish use of a temporary file for download due to a problem with shared memory