fixed pdf issues with appending the html to the response