bug fixes with paging