Tenger Plugin: query loop