Added a failsafe for loading database.