Convert back to flat_map