add a better html output debug function for queries