fix proper print of query