cleanup phppaper.js