fixing write.pdf