Updating read_pdf function

- Fix the returning partial results issue (wait = FALSE -> wait = TRUE)
- Minor changes