added download function to checkfile