handle bad database files better and notify user