change fold_map to standard signature