Fixed so that it returns a file named output.pdf which is recognized as a pdf, as well as changed permissions on the pdfmerger