print correct query