fixing PDF bugs