check file before link