add pagination function and fix conversation bugs