make previous and next button work for pager control