fix the rollup function bug