fixing cleanup of history and distriman