update for db query