Introduced the DOM file and added the isPageEndReached function