Fixed the file check script