updated for query builder