fix bug with model::query()