fixed bug in generating path for pdf files