changed db query