Changed database checking of filenames