query builder working for selections