add paginates and have some error fixed