fixed loading database from file