Fixed application crash on interrupted download
Downloading to temporary directory
Code reformat