fixed logic dependent on linked databases