fixed the querybuilder to work not sure if it's the  best way though