Fix out of page in paginate