adding histroy pagination