fixed some pdf bugs