can you explain how you think this fixes it? seems like the `case_dict` would be in an inconsistent state after these lines depending on what was in there