fixed a bug while calling the completion block in the document from file method