added code to clean up partially downloaded manifest file when the download fails in the middle
merge