Make paginate work