added query terms to Samples sync code