modified convert to pdf add managing error