now checks if file exists before downloading