fixed to use the ds_type into temporary query struct