fix fold_n