add readPage function