Fix a bug related to opening multiple pdf documents at the same time.