null check for downloadFile