cleaner way to show queries
bugfix