fixed pdf generating