checking if file exists before downloading