query building with topic works