fixed a bug with query builder