Don't generate pdfs when some other button was clicked