iterate over copy of topic dictionary during cleanup