Updated DB query