Fix a missing db query.