changes to db query