Fix loading database