added paginate support