Updated db query.