add getpage function
new deal logic