corrected failure callback for pdf generation