Fixed issue with script not outputting all results to PDF