generating single pdf pages
query fix