modified the clean procedure for PDFs