Defensive
Fixes a bug associated with asynchronous database access.