added paginate feature