fixed readDocumentByPage for empty results