fail gracefully when database is corrupted