fixed issues with regexp and .pdf return(though .pdf isn't still working as expected.)