DB Query fix for Issue #296