fixbug around partial sum()