Download pdf function overwrite fix.