Fixed pdf issue with redirect