implement paging on messages