set up data_str for saving
cleanup