added ability to check length of download file