stop modifying dict as we iterate over it