fixed query builder bug