dedicated script to deal with paging