add pagination functions