check for file before hashing