debug prints in base query template